Mounting Smb Windows Shares in Linux

Browsing the windows network from a ubuntu computer is not working out of the box. You have to setup new mounts for every shared folder from windows pc.

Let’s assume that you have a Windows pc with one shared folder called “multimedia” and its IP address is “192.168.1.18”. Passwordless shares do not work for Linux (in fact they are highly not recommended).

  • First we have to create a new file containing login details :
sudo nano /root/.windowspc
  • We’ll add login details :
username=winusername password=winpassword
  • Make sure only root access this file :
sudo chmod 400 /root/.windowspc
  • Create a new folder where we’ll mount the shared folder :
mkdir /media/multimedia
  • Add this mount to the startup :
sudo nano /etc/fstab
  • Add this line :
//192.168.1.18/multimedia /media/multimedia cifs uid=1000,credentials=/root/.windowspc
  • Mount this folder :
sudo mount - a
  • Now go to your file explorer and open the new network mount.

  • If you get permission error, you can check the correct uid using this command :

id

Copyright

Comments