Access Windows shares using Samba from command line

  7 years ago


apt-get install samba4 to get the latest version of Samba.

apt-get install cifs-utils to get necessary files/utils required to mount Windows shares.

Then do the following:

mkdir /mnt/share

Type the following command to mount the share:

mount -t cifs //windowsmachineip/sharename -o username=user,password=urPassword /mnt/share

On older machines the shares could be mounted as follows:

mount -t smbfs -o username=user,password=urPassword //windowsmachineip/sharename /mnt/share

jahid_0903014 6 years ago


Ishwon 7 years ago

Hello andre_win. When you have spaces in folder names, you escape it using "\" (a backslash). You can also provide the whole path between quotes.

Ishwon 7 years ago

Hello Andre. In case of spaces, you specify the path in quotes.
E.g if the location is //windowsmachine/this is my folder, you just put it as '//windowsmachine/this is my folder'.

eillinois32 7 years ago

Great tutorial, here's how I did mine(I'm a beginner, mounting shares from a Windows 8 machine in a workgroup):

enter root password
apt-get install samba4
apt-get install cifs-utils
mount -t cifs //windowsmachineip/sharename -o username=user,password=urPassword /mnt /share


cd mnt


cd share

done, able to view files.

Now I just need to find a way to view the share in 'places'.

andre_win 7 years ago

Hello! What should I write at sharename if there is a space in folder name? Thanks.