Monday, September 8, 2014

share file from linux using samba

1- install samba
root@localhost # apt-get install samba

2- configure samba to share a directory
edit file /etc/samba/smb.conf by adding the following link
*** note *** the configuration below is to share directory in path /home/usershare/sharedir with share name "sharedir"

[sharedir]
   comment = My share directory movies
   browseable = yes
   path = /home/usershare/sharedir

   #printable = yes
   #guest ok = yes
   read only = yes
   #create mask = 0700


3- create user usershare
root@localhost # useradd -m usershare



4- create smb password for usershare
root@localhost # smbpasswd -a usershare

5- create directory in home directory of usershare using usershare to create
usershare@localhost $ mkdir /home/usershare/sharedir

6- restart samba password
root@localhost # service smbd restart

7- when access the directory \\serverip\sharedir, it will prompt for username/password, so input usershare and password (smbpasswd)
if you want to share to everyone uncomment the link guest ok =yes in the configuration above.

No comments:

Post a Comment