Installing network file system  – command line installation


Network shares can be configured in two ways (One via SAMBA and through NFS) or in other words Linux network shares uses two different protocols to mount shares across network.
Samba uses SMB protocol to mount shares. NFS uses nfs protocol to mount network shares. 
This post describes How to creates network shares using SAMBA
(Link to How to create shares using NFS)
1. Install samba server from shell command
sudo apt-get install samba smbfs
for centos 
yum install samba
2. Edit the configuration file to adjust settings.
sudo nano /etc/samba/smb.conf
find the clobal configuration item in smb.conf file and should be starting with
#
[global]
#Security = USER
And add these lines under; these lines are creating share folders.  [homes] means, this is a share name home with description ‘Home directories’, and it’s not browseable, which means its hidden. Every user connected to this samba server can connect directly to his /home/directory

hosts allow =
[homes]
comment = Home directories
browseable=no
writable=yes
Another share folder called ‘share’ which is accessible by all users.
[share]
comment=File Server
path = /share/    /*Directory must present*/
force user = samba
force group = samba
read only = No
hosts allow =
If you want more share folders, just name them within [], specify path and remaining are same.
3. Add users in linux server.
sudo adduser linuxuser
this is to create a new user in linux server and create a new password
4. Creating password for this user to access shared folder
sudo smbpasswd –a linuxuser
5. Restart samba server.
Sudo /etc/init.d/smbd restart
Download As PDF

No comments:

Post a Comment