Access Windows shares using Samba from command line

Ishwon
  11 years ago
  6

 

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

Comments
jahid_0903014 10 years ago

useful


Ishwon 11 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 11 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 11 years ago

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

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

ls

cd mnt

ls

cd share

done, able to view files.

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





andre_win 11 years ago

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