Search This Blog

Friday, October 25, 2019

Mount Remote Network Folder Share locally in UBUNTU

This whole article is based on the below page...


https://forums.linuxmint.com/viewtopic.php?t=70187


Still I would like to summarize in short steps for mounting a remote Network Share Folder Locally.

1. Enter this into a terminal to install smbfs.
CODE: 
sudo apt-get install smbfs

2. Enter this into a terminal to add the samba goup.

CODE: 
sudo groupadd samba
3. Enter this into a terminal replacing user with your actual user name to add yourself to the samba group.
CODE: 
sudo adduser user samba
Example: For me it would be sudo adduser jason samba since my user name is jason.

4. Enter this into a terminal to edit your sudoer file.
CODE: 
sudo vim /etc/sudoers
5. Paste this into the last line of the file.
CODE: 
%samba   ALL=(ALL) /bin/mount,/bin/umount,/sbin/mount.cifs,/sbin/umount.cifs

6. Save and close the sudoer file.

7. Enter this in a terminal to create credentials for your share.

CODE: 
sudo vim /etc/samba/user
8. Paste this into the file using your the actual username and password for the share. Replacing admin with the actual username of the share and passwordwith the actual password of the share.
CODE: 
username=admin
password=password
Example: admin is the actual username of my samba share and password is the actual password of my samba share.

9. Save and close the file.

10. Enter this in a terminal to make a mount point for your share changing samba_share to whatever you want to call the folder. *A tip The fstab doesn't like spaces in folder names. Avoid them in the mount point and share folder name.
CODE: 
sudo mkdir /media/samba_share
11. Enter this into a Terminal to open your fstab.
CODE: 
sudo vim /etc/fstab
12. Add this line to your fstab to tell your system what it's mounting and where to mount it to, replacing myserver_ip_address with the actual IP of your share, in your case 192.168.0.1 and myshare with the actual path to the folder you want to mount in that share.
CODE: 
//myserver_ip_address/myshare  /media/samba_share  cifs  credentials=/etc/samba/user,noexec  0 0
13. Save and close your fstab.

14. Test your samba mount by entering this into the terminal replacing samba_share with whatever you decided to call your samba share mount point.
CODE:
sudo mount /media/samba_share
Example: I entered this to mount my samba shares. the "&&" just tells the commands to run one after the other.
CODE:
sudo mount /media/DocumentShare && sudo mount /media/MusicShare && sudo mount /media/PictureShare && sudo mount /media/VideoShare
If all goes well your share will show up as a mounted file system and be usable by your system and apps like any other drive locally attached to your computer.