Automount smb share with r/w for a user

UPDATE: smbfs is no longer available, use “apt-get install cifs-utils” and cifs instead of smbfs when moutning.


Quick info for myself on auto mounting a smb share.’, ‘you need to have smbfs installed.

# apt-get install smbfs

# vi .smbuser


# vi /etc/fstab


//serverIP/ShareName /mnt/data smbfs credentials=/root/.smbuser,uid=1000,gid=1000

That\’s it. UID and GUID = the ID of the user with read/write permission. credentials point at the file created above.


# mount -a

to test it out.

NOTE for Ubuntu. I don\’t know why they don\’t just set this by default.. it\’s so annoying!

Add this to .vimrc in your home directory:

set nocompatible