4

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?

10
  • have you tried sudo mount -a Dec 27, 2012 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, 2012 at 10:01
  • why are you trying via ssh ? in post you have mention cifs. Dec 27, 2012 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, 2012 at 10:26
  • @chalist Shouldn't it be sudo mount -t cifs //172.30.12.37/test /home/my/afs37/?
    – Karlson
    Dec 27, 2012 at 16:52

2 Answers 2

1

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).

0

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.

1
  • Don't work dude
    – Chalist
    Dec 29, 2012 at 7:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .