Skip to main content

Mounting a Network Drive in Ubuntu

In this post we will look at how mount a network drive in Ubuntu.
Install CIFS:
[pre class="brush:bash"]
sudo apt-get install cifs-utils[/pre]
Mount password protected network folders
Using a text editor, create a file for your remote servers logon credential:
[pre class="brush:bash"]
gedit ~/.smbcredentials[/pre]
Enter your Windows username and password in the file:
[pre class="brush:bash"]
Save the file, exit the editor.
Change the permissions of the file to prevent unwanted access to your credentials:
[pre class="brush:bash"]
chmod 600 ~/.smbcredentials[/pre]
Then edit your /etc/fstab file (with root privileges) to add this line (replacing the insecure line in the example above, if you added it):
[pre class="brush:bash"]
//servername/sharename /media/windowsshare cifs credentials=/home/ubuntuusername/.smbcredentials,iocharset=utf8,sec=ntlm 0 0[/pre]
If you want to mount the SMB drive with write access
[pre class="brush:bash"]
//servername/sharename /media/windowsshare cifs credentials=/home/ubuntuusername/.smbcredentials,uid=1000,gid=1000,iocharset=utf8,sec=ntlm 0 0[/pre]
Save the file, exit the editor.
Finally, test the fstab entry by issuing:
[pre class="brush:bash"]
sudo mount -a[/pre]
More secure way of login in: Following command will ask the password when entered:
[pre class="brush:bash"]
sudo mount -t cifs // /media/mount_directory -o sec=ntlmssp,uid=1000,gid=1000,user=username[/pre]


Popular posts from this blog

How to Safely Uninstall Python from Mac OS X

Mac Laptops comes with Python pre-installed, but if you install another version of Python probably from it might interfere with the default Python installation. Thus it is recommended to install other Python versions through Homebrew or mac ports.

Advantages and Disadvantages of Electro-oculography (EOG)

In the previous post we looked at what is EOG? In this post we will look at the advantages and disadvantages of EOG.

What is your Lucky Colour?

Colours and You
Which colour can bring you luck and enhance your day? This can be identified by calculating the birth number,