Mount Samba shares (why doesn't Nautilus work?) and making smb mounts permanent

Mount Samba shares
Apparently it is very easy to connectfrom within Nautilus to Windows computers (or rather to computers running smb services). The only thing you have to do is to type smb:/// into the URL bar and the network is browsed for available domains, workgroups and services. However when one tries to open some files (e.g. some image) there often appears the error message that those files cannot be accessed via samba.

What to do? I figured that when you mount smb shares, that this works correctly. In order to mount my user directory on another computer this is the command:

sudo mount -t smbfs -o username=michael,password=here_goes_my_password //paula/michael /mnt/smb

paula is the netbios name of the other computer and michael is the name of the share.

You can also set the owner of all the files of the mounted file system with the -o uid=owner option:

sudo mount -t smbfs -o username=michael,password=here_goes_my_password -o uid=500 //paula/michael /mnt/smb

If you don't want to type your password, you can save it in a file like this:


and then you can refer to this "credentials" file:

sudo mount -t smbfs -o username=susanne,credentials=/home/susanne/.smbpasswd //patolmac217/susanne /mnt/smb

In order to unmount use:

sudo umount /mnt/smb

This mostly fails as you are likely to have some open windows/terminals that keep the connection active. Close them and try again. You also might try umount -f.

Making smb mounts permanent
When you mount an SMB share, it will be gone upon system restart. To make it mount automatically during system bootup, you have to create a new entry in the /etc/fstab file. In my case e.g.:

//paula/michael /mnt/smb smbfs credentials=/home/jeltsch/.smbpasswd 0 0

In the .smbpasswd file is my username and my password. Probably not very safe, but who cares? .smbpasswd should be anyway only readable by yourself!