Advertisement
efxtv

How to Create shared folders in Ubuntu PC [ SMB ]

Sep 1st, 2023 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | Cybersecurity | 0 0
  1. Topic: How to Create shared folders in Ubuntu PC.
  2.  
  3. What is samba according to google?
  4.  
  5. Samba enables Linux / Unix machines to communicate with Windows machines in a network. Samba is open-source software. Originally, Samba was developed in 1991 for fast and secure file and print sharing for all clients using the SMB protocol. Since then it has evolved and added more capabilities
  6.  
  7. - Access shared files in the same network
  8. - Hard Disk/Directory Sharing
  9. - Windows7/10/xp Android Linux
  10. - Access via network
  11. - Password-protected directory
  12. - Public Directory
  13. - User RS File on Play Store to access samba files https://play.google.com/store/apps/details?id=com.rs.explorer.filemanager&hl=en&gl=US
  14.  
  15. ========= CREATE PASSWORD PROTECTED DIRECTORY
  16.  
  17. # Install samba in Ubuntu
  18. $ sudo apt install samba -y
  19.  
  20. # Start samba service
  21. $ sudo systemctl enable --now smbd
  22. $ sudo smbdpasswd -a demo
  23.  
  24. # Check samba service status
  25. $ sudo systemctl status smbd
  26.  
  27. # Create directory in home to share
  28. $ cd; mkdir shared
  29.  
  30. # Create new user in samba
  31. $ sudo smbpasswd -a demo
  32.  
  33. # Edit samba configuration file and enter the shared folder details
  34. $ sudo nano /etc/samba/smb.conf #add text at the end
  35. [Host_shared]
  36. path = /home/demo/shared
  37. read only = no
  38. valid users = demo
  39.  
  40. # Reload Samba service
  41. $ sudo systemctl restart smbd
  42.  
  43. # Access folder in linux
  44. smb://IPADDRESS/
  45.  
  46. # Access folder in windows
  47. \\IPADDRESS
  48.  
  49. ========= CREATE PUBLIC DIRECTORY
  50.  
  51. # Create a directory shared_shared
  52. $ sudo mkdir shared_shared
  53.  
  54. # Change owner permissions
  55. $ sudo chown nobody:nogroup shared_shared
  56. $ sudo chmod g+w,o+w shared_shared
  57.  
  58. # Do the changes in Samba config file
  59. $ sudo nano /etc/samba/smb.conf # add at the end of file
  60. [Host_public]
  61. path = /home/demo/shared_shared
  62. guest ok = yes
  63. read only = no
  64. force user = nobody
  65.  
  66. # Reload the samba service
  67. $ sudo systemctl restart smbd
  68.  
  69. # Reload Samba service
  70. $ sudo systemctl restart smbd
  71.  
  72. # Access folder in linux
  73. smb://IPADDRESS/
  74.  
  75. Telegram post https://t.me/efxtv/2718
  76.  
  77. EFXTV Hacking Channel (https://t.me/+O_PSFKW8-Lw0M2Rl)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement