Menu Close

How to mount Windows Shared Folders on Debian

 

If you need to have easy access to Windows Shared Folders from your debian (or any other linux distro) steps are very easy!

 

 

Before starting, you need:

– Samba on your debian computer

– UserName and Password of a Windows User that can access to the shared folders

– The path of the folders (es. “//server/cartella” or “//192.168.0.1/cartella”)

– Root access on your debian computer

 

First of all, we need to create a local folder where to mount the shared folder:

# mkdir -p /mnt/windowsserver

Where “windowsserver” is a casual name that you can choose.

 

After that, you can mount the shared folder on your local folder:

# mount -t cifs //windowsserver/folder -o username=ferdy,password=MyPassword /mnt/windowsserver
Where “//windowsserver/folder” is the complete path of the shared folder (for me, the hostname didn’t work, so i used the ip)

 

Now you can easy access to /mnt/windowserver for see the file of Windows Shared Folder:

# cd /mnt/windowsserver

Great, but how to do for automount the folder at the boot of the system? Easy!

The solution stay in the file “/etc/fstab”, the file that list every filesystem to mount.

So, modify with:

# nano /etc/fstab
And add this line :
//windowsserver/folder /mnt/windowsserver      smbfs   username=ferdy,password=MyPassword 0 0
NOTE: If you have to use this folder with APACHE, the command is:
//windowsserver/folder /mnt/windowsserver      smbfs   username=ferdy,password=MyPassword,uid=root,gid=www-data,nounix,file_mode=0777,dir_mode=0777 0 0

If you don’t like the console, you can do these steps with a graphic utility:

# apt-get install pyneighborhood

this simple tool give us access to all computers on our network and simple mount with one click.

 

################## UPDATE!! ##################

I notice you can use cifs file system too! The syntax is:
//windowsserver/folder /mnt/windowsserver      cifs user,password=MyPassword,username=ferdy 0 0
cifs should be more stable that smbfs. Choose your prefer ! 🙂
############################################
Posted in Linux, News

Leave a Reply

Your email address will not be published. Required fields are marked *