Access Linux (Samba) Share from Linux Command Line
By Shay Anderson on September 2013
Here is how to access a Linux share (Samba) from another Linux machine:
Install smbfs: # apt-get install smbfsCreate directory for mount: # mkdir /mnt/linuxshareMount the share: # mount -t smbfs -o username=[username] //[server IP, ex: 192.168.1.100]/[share name] /mnt/linuxshare
Permanently Mount Linux Share
Now that the we have mounted the share we can use it, however, if we reboot the machine the share will be gone. To permanently mount the linux share use: # nano /etc/fstabAdd line for share: # start linux share
//[server IP, ex: 192.168.1.100]/[share name] /mnt/linuxshare smbfs credentials=/mnt/.smb_creds,uid=1000,gid=1000Save file and create credentials file: # nano /mnt/.smb_creds Add the following lines: username=[username]
password=[password]Save file and set permissions: # chown root /mnt/.smb_creds
# chmod 600 /mnt/.smb_credsNow you should be able to see Linux network share: # df -h
Unmount Share
To unmount share correctly execute the following (use umount, not a typo): # umount /mnt/linuxshare
# rm -Rfv /mnt/linuxshare
NOTE: if you remove the mounted directory contents all the contents will be removed on the remote share, correct way to remove is to unmount share
http://www.shayanderson.com/linux/access-linux-samba-share-from-linux-command-line.htm