Thursday, 5 January 2012

Mount Windows share on Ubuntu with CIFS

The package that is needed to be installed is called smbfs.

For permament mount at every boot add something like this to /etc/fstab:

// /media/servfolder cifs username=xxxxx,password=yyyyyy,uid=1000,gid=1000,file_mode=0777,dir_mode=0777noserverino,rw,nolinux,iocharset=utf8 0 0

As a shell script, the command would be like this:

mount -t cifs //192.168.x.x/hostdir /opt/clientdir -o username=hostuser,password=hostuserpass,uid=1000,gid=1000,file_mode=0664,dir_mode=0775,noserverino,rw,iocharset=utf8