Ubuntu MOUNT in FSTAB fails when passing credentials
Posted on 2011-10-25
This one is driving me up the wall.
I am simply trying to mount a CIFS share into the /mnt directory of this Ubuntu 10.04.3 LTS host.
From a command line, I can issue "mount -t cifs //<host ip>/media -o username=<user>,password=<password> /mnt/nasmedia" This loads fine, the drive is mounted. I can browse and list files. Tells me that credentials , networking, etc... are all working.
I create a credentials file in /home/mike/ called smbauth. I made sure there were no trailing <CR> in the file.
So I add this to /etc/fstab with:
//host ip/media /mnt/nasmedia cifs credentials=/home/mike/smbauth,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
I issue a 'mount -a' and get the following in dmesg:
[2412953.517721] CIFS VFS: No username specified
[2412953.517868] CIFS VFS: cifs_mount failed w/return code = -22
In Fstab if I replace the credentials file with username/password like this, it works:
//host ip/media /mnt/nasmedia cifs username=<username>,password=<password>,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
So, why won't fstab read in the credentials file? Any ideas? Guesses?