Skip to main content

Map Network Drive in Ubuntu

Guide to mounting a network drive on Ubuntu From Windows Server:

Install CIFS:

sudo apt update
sudo apt install cifs-utils
sudo mkdir /mnt/localcloud
sudo nano /etc/smbcredentials

Put this in the file you create

username=windows_username
password=windows_password

Secure the Permissions

sudo chmod 600 /etc/smbcredentials

Change the /etc/fstab file and add the network location to the bottom of it:

sudo nano /etc/fstab

Add the following line to the file:

//192.168.1.121/localcloud /mnt/localcloud cifs credentials=/etc/smbcredentials,uid=1000,gid=1000,vers=3.0 0 0

Make the Directory:

sudo mkdir /mnt/localcloud

Mount the drive:

sudo mount -a

 Your uid=1000 and gid=1000 with the user ID and group ID of the user you want to own the # files after mounting (use id -u zippyb to find your UID, and id -g zippyb to find #your GID.

sudo id -u zippyb
sudo id -g zippyb

check to see if the network drive is mounted:

ls -la /mnt/localcloud

Output:

2024-06-07 20_47_22-zippyb@pivpn_ ~.png

Optional:

Manually Mount the Drive:

sudo mount -t cifs -o credentials=/etc/smbcredentials,uid=1000,gid=1000,vers=3.0 //192.168.1.121/localcloud /mnt/localcloud