Thursday, March 27, 2008

How to share files and folder in ubuntu

How to install Samba Server for files/folders sharing service


sudo apt-get install samba smbfs


How to add/edit/delete network users


sudo smbpasswd -a system_username
gksudo gedit /etc/samba/smbusers
    • Insert the following line into the new file
system_username = "network username"


  • To add network user
sudo smbpasswd -a system_username
  • To delete network user
sudo smbpasswd -x system_username
  • To enable network user
sudo smbpasswd -e system_username
  • To disable network user
sudo smbpasswd -d system_username
    • By Default network users are disabled after adding them, make sure you run the enable network user command above.

How to share home folders with read only or read/write permission (Authentication=Yes)


sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Find this line
...
; security = user
...
  • Replace with the following lines
  security = user
username map = /etc/samba/smbusers
  • Remove the ; in front of the following lines (there will text in between explaining what they do):
;[homes]
;comment = Home Directories
;browseable = no
;valid users = %S
;writable = yes
    • If you want other network users to be able to edit to the folder then change
 # By default, the home directories are exported read-only. Change next
# parameter to 'yes' if you want to be able to write to them.
; writable = no
    • Replace with the following lines
  writable = yes
  • Save the edited file
sudo testparm
sudo /etc/init.d/samba restart


0 comments: