Mounting cifs Shares in Ubuntu

linux osx ubuntu

As previously mentioned, I've got a mac mini set up as a fileserver. That's not very useful if I can't easily get at the files from my linux machine. While Kubuntu fully supports browsing samba shares via smb:/machinename , that doesn't work with most linux apps.

My first attempt was to mount the shares using smbfs, which worked okay for browsing in a terminal, but which managed to hang amarok when I tried adding them to my collection. Not cool. Instead, I'm now mounting them as cifs shares, which works much better.

First, I created a new user called "media", that isn't actually allowed to log in (shell is set to /bin/false). Then I added that user and my own user account to the "media" group so I can actually read and write the share.

in /etc/fstab:

//192.168.1.105/music /mnt/music cifs rw,nosetuids,
   noperm,credentials=/etc/cifs.credentials,
   uid=999,gid=1002,dir_mode=0775,file_mode=0775,
   nouser,noexec,nosuid 0 0

(the options should not be broken across multiple lines, that's for formatting only.)

That specified a lot of options. Here's the breakdown:

Finally, set up the CIFS credentials in the file referenced:

/etc/cifs.credentials:

username=media
password=ThePassword