Wrigs

Samba Setup - Ubuntu

Mar 1st, 2026
9,059
0
Never
13
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. Samba file sharing scenario:
  2. • 3 private shares
  3. • Each mapped to one user only
  4. • Force ownership of all files to that user
  5. • 1 public share (read/write for everyone)
  6. • No interactive login allowed
  7.  
  8. 1. Install Samba:
  9. sudo apt update
  10. sudo apt install samba
  11.  
  12. 1a. Enable service:
  13. sudo systemctl enable smbd
  14. sudo systemctl start smbd
  15.  
  16. 2. Create a base directory:
  17. sudo mkdir -p /srv/samba/{user1,user2,user3,public}
  18.  
  19. 3. Create Non-Login System Users
  20. • Disable shell access
  21. • Disable home directory creation
  22.  
  23. sudo useradd -M -s /usr/sbin/nologin user1
  24. sudo useradd -M -s /usr/sbin/nologin user2
  25. sudo useradd -M -s /usr/sbin/nologin user3
  26.  
  27. 3a. Verify:
  28. getent passwd user1
  29.  
  30. 3b. You should see:
  31. user1:x:1001:1001::/home/user1:/usr/sbin/nologin
  32.  
  33. ✔ Cannot SSH
  34. ✔ Cannot log in locally
  35.  
  36. Public Folder:
  37.  
  38. Create a shared group:
  39. sudo groupadd smbpublic
  40. sudo usermod -aG smbpublic user1
  41. sudo usermod -aG smbpublic user2
  42. sudo usermod -aG smbpublic user3
  43.  
  44. Set ownership:
  45. sudo chown root:smbpublic /srv/samba/public
  46. sudo chmod 2775 /srv/samba/public
  47.  
  48. Explanation:
  49. • 2 sets the SGID bit
  50. • New files inherit group smbpublic
  51. • 775 allows group write
  52.  
  53. 5. Add Samba Passwords
  54. sudo smbpasswd -a user1
  55. sudo smbpasswd -a user2
  56. sudo smbpasswd -a user3
  57.  
  58. 5a. Enable them:
  59. sudo smbpasswd -e user1
  60. sudo smbpasswd -e user2
  61. sudo smbpasswd -e user3
  62.  
  63. 6. Configure Samba
  64. sudo nano /etc/samba/smb.conf
  65.  
  66. 6a. Ensure in [global] section:
  67. security = user
  68. map to guest = never
  69.  
  70. 6b. Private Shares (Ownership Forced). Add:
  71.  
  72. [user1]
  73. path = /srv/samba/user1
  74. valid users = user1
  75. read only = no
  76. browseable = yes
  77. force user = user1
  78. create mask = 0600
  79. directory mask = 0700
  80.  
  81. [user2]
  82. path = /srv/samba/user2
  83. valid users = user2
  84. read only = no
  85. browseable = yes
  86. force user = user2
  87. create mask = 0600
  88. directory mask = 0700
  89.  
  90. [user3]
  91. path = /srv/samba/user3
  92. valid users = user3
  93. read only = no
  94. browseable = yes
  95. force user = user3
  96. create mask = 0600
  97. directory mask = 0700
  98.  
  99. ✔ force user ensures all files are owned by that user
  100. ✔ Even if accessed from Windows as that user
  101.  
  102. 7. Public Share. Add:
  103.  
  104. [public]
  105. path = /srv/samba/public
  106. valid users = @smbpublic
  107. read only = no
  108. browseable = yes
  109. force group = smbpublic
  110. create mask = 0664
  111. directory mask = 2775
  112.  
  113. Explanation:
  114. • Any authenticated user in smbpublic can read/write
  115. • Group ownership is forced
  116. • SGID keeps group consistent
  117.  
  118. 8. Test Configuration
  119. sudo testparm
  120.  
  121. If no errors:
  122. sudo systemctl restart smbd
  123.  
  124. 9. Firewall (if enabled)
  125. sudo ufw allow samba
  126.  
  127. 10. What You Now Have:
  128.  
  129. Share Access Ownership Behavior
  130. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  131. user1 user1 only All files owned by user1
  132. user2 user2 only All files owned by user2
  133. user3 user3 only All files owned by user3
  134. public All users Group-owned, shared
  135.  
  136. ✔ No SSH login
  137. ✔ No shell access
  138. ✔ Clean forced ownership
  139. ✔ Proper group inheritance
Tags: samba
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Sinmirin
    208 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment