Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to automount some drives with smb with fstab entries as such.

# auto mount hda shares
//hda/DeannasDocs /home/deanna/DeannasServerDocs cifs user=deanna,pasword=** 0 0
//hda/Music       /home/deanna/ServerMusic        cifs user=deanna,pasword=** 0 0
//hda/Pictures    /home/deanna/ServerPhotos      cifs user=deanna,pasword=** 0 0

if I click on one of these drives I get an error "only root can mount"

If I manually mount with

sudo mount -a

I'm prompted for a password and they mount just fine. What the heck is going on here?

Answer: Of course it was something stupid.

I copied the syntax for the mount from offline and it has "pasword" instead of "password". It stood out initially but I thought it was just a Unix foible.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

As a default, only root is allowed to mount / unmount volumes. You have to allow for other users with the "user" or "users" mount option, for example:

//192.168.1.100/Daten /home/otto/Daten cifs noauto,users,credentials=/home/otto/.smbcredentials  0 0

Where the .smbcredentials file contains username and password:

username=otto
password=wakeuplimeyfish

The noauto option means that the system will not mount the share automatically.

Of course, you do not need all of that to mount a Windows share as a regular user. Just open a file manager window and go to Browse Network -> Windows Network, select the share you want to mount, type the password etc. Or give the location (menu go -> location): smb://Fileserver/share, type in your domain / password etc.

Or use gvfs directly from command line:

gvfs-mount 'smb://user@fileserver/share'
share|improve this answer
    
"As a default, only root is allowed to mount / unmount volumes." so is fstab not loaded by root at startup anymore? Realistically, my wife is not going to manually mount our media shares. –  jeremyjjbrown Aug 19 '12 at 20:21

I have succeeded in this, by doing the following on fstab

//192.168.1.1/SharedFolder /mnt/SharedFolder cifs guest,uid=1000,iocharset=utf8,codepage=unicode,unicode 0 0

make sure you have created the /mnt/SharedFolder location, and have given regular users permissions to read/write

share|improve this answer
    
I'm just not going to give regular users permissions on my home server. –  jeremyjjbrown Aug 19 '12 at 20:23

Did you create the ~/.smbcredentials as required?

read: https://wiki.ubuntu.com/MountWindowsSharesPermanently

share|improve this answer
    
I've never needed that before. I've just specified the creds in the fstab on every linux install I've ever done. Is the creds now the only was to do it in Ubuntu? –  jeremyjjbrown Aug 19 '12 at 19:16
    
According to that document my fstab is exactly correct. –  jeremyjjbrown Aug 19 '12 at 20:34
    
"According to that document my fstab is exactly correct." I guess it was not exactly correct. Thanks! –  jeremyjjbrown Aug 19 '12 at 21:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.