How to Mount CIFS File system (SAMBA Shares) on remote Windows/Linux systems.


How to create network shares in Linux 
Samba shares can be mounted across both Linux and windows systems. Earlier samba was using NFS file share, which is Network File System, more vulnerable to attack. Recent days, samba uses CIFS (Common Internet File System) which is considered as more secure than NFS.
To mount share in windows
Just open run command and type share name, for e.x if the server name is 192.168.1.85 and shared folder name is 'Share'.
//192.168.1.85/Share
Mount shared folder in Linux
For temporary mount type, 
mount -t cifs //192.168.1.85/Share /localdirectory/tmp/ -o username=user, password=pass
This command mount the remote share locally in specified directory.
To mount permanently, type
edit /etc/auto.misc and add 
net -fstype=cifs,rw,username=user,password=pass ://192.168.1.85/Share
The permanent mount location would be /misc/net directory. (Note: net Folder inside misc need not to be present)

Finally Restart or Start Automount services as ,
/etc/init.d/autofs restart
To verify the mounted drives, Goto folder /misc/net and list the directories.
#ls -lh /misc/net

Download As PDF

No comments:

Post a Comment