Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I add a folder in /etc/fstab:

//172.30.12.37/test/ /home/my/test cifs user=afs,pass=123456,auto,exec,umask=002,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 0 0

Now test link can be seen in nautilus sidebar. But when I click on this icon, an error will be displayed:

mount: only root can mount //172.30.12.37/test/ on /home/my/test

How I can mount this folder from terminal with root user?

share|improve this question
    
have you tried sudo mount -a –  Rahul Patil Dec 27 '12 at 9:11
    
sudo mount ssh://172.30.12.37/afs/ /home/my/afs37/‍‍ And result: wrong fs type, bad option, bad superblock on ssh://172.30.12.37/afs –  chalist Dec 27 '12 at 10:01
    
why are you trying via ssh ? in post you have mention cifs. –  Rahul Patil Dec 27 '12 at 10:12
    
mount 172.30.12.37/test /home/my/afs37/ >>> result >>> mount: special device 172.30.12.37/test does not exist –  chalist Dec 27 '12 at 10:26
    
@chalist Shouldn't it be sudo mount -t cifs //172.30.12.37/test /home/my/afs37/? –  Karlson Dec 27 '12 at 16:52

2 Answers 2

Try adding the user option in your opts at /etc/fstab.

From man 8 mount:

user Allow an ordinary user to mount the filesystem. The name of the mounting user is written to mtab so that he can unmount the filesystem again. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line user,exec,dev,suid).

share|improve this answer

You have more options:

  1. replace user asf and its pass with root and root password, if you have any. Since you are on Ubuntu, it's not trivial.
  2. add rights to user "asf", allow him to mount as root. Create one file in /etc/sudoers.d/ as root, named i.e. asf-mount, and with the following one line content:

    asf ALL=NOPASSWD: /bin/mount
    

Also change the access rights of this file to read-only: sudo chmod 440 /etc/sudoers.d/asf-mount, and logout and login again with user asf.

share|improve this answer
    
Don't work dude –  chalist Dec 29 '12 at 7:15

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.