Mount/ map a network drive/ network share/ directory/ folder in Ubuntu



Install smbfs
$ sudo aptitude install smbfs

Create a folder to mount:
$ sudo mkdir /media/example

Open fstab, then add some lines with the basic form:
# Mount our network drive
//SERVER/SHARE /MOUNT-POINT smbfs guest 0 0


Open fstab with sudo privileges
$ sudo vim /etc/fstab

Then add the following lines:
# Mount Network Share With Credentials
//192.168.1.101/share1 /media/example cifs username=exampleuser,password=exampleuserpassword,file_mode=0777,dir_mode=0777  0  0


Description:

  • //192.168.1.101/share1:  IP address or name of file server followed by the share name
  • /media/example: This is the mount point where our network share will reside
  • username=exampleuser,password=exampleuserpassword: the username and password to the share
Apply changes:
$ sudo mount -a

No comments:

Post a Comment