LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-05-2011, 07:22 AM   #1
revinary
LQ Newbie
 
Registered: Mar 2011
Posts: 12

Rep: Reputation: 1
Problem with sudo and mounting as user


Hi all,

I am running Debian testing + Gnome 2 and have added !authenticate to the Defaults in my sudoers file.

It had the desired effect: neither sudo nor gtksudo (which is configured to use sudo as backend) require entering my password anymore
EXCEPT
when I try to mount a device in nautilus it always asks me to enter my user password (which indicates that sudo is used to grant the rights).

Any ideas why in the paticular case of mounting storage the !authenticate option has no effect?

Thanks,

rev
 
Old 10-05-2011, 08:17 AM   #2
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
Is it a specific account that is mounting or is it all users?

For specific user add:

userName ALL=NOPASSWD: /bin/mount /filesystem

OR for all users

users ALL=NOPASSWD: /bin/mount /filesystem


Note: /bin/mount maybe a different path depending on how your box is set up.
 
Old 10-06-2011, 03:01 AM   #3
revinary
LQ Newbie
 
Registered: Mar 2011
Posts: 12

Original Poster
Rep: Reputation: 1
Thanks for your reply,

what exactly does /filesystem stand for?

Anyway, shouldn't the !authenticate option in my sudoers file disable password checks ENTIRELY?

My sudoers file looks like this atm:
Code:
Defaults	env_reset,!authenticate,editor=/usr/bin/nano
Defaults	secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

root	ALL=(ALL:ALL) ALL
%sudo	ALL=(ALL:ALL) NOPASSWD:ALL
Again, using sudo/gksu/gksudo works without asking for my p/w EXCEPT when mounting a device with nautilus.

Note, the device is an external eSATA drive. If I attach it via USB it gets mounted automatically and without requireing a p/w.

Any clues?

Cheers,

rev
 
Old 10-06-2011, 08:41 AM   #4
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
Mounting with Nautilis is a bit buggy in general with Debian Distro. The Ubuntu forums are filled with threads about it. Some of the posts date all the way back to 02-07-2010.

Yes,!authenticate should work. /filesystem is whatever your mount point is to in fstab.

Example:
fstab file:
Code:
192.168.200.25:/content /content   nfs  defaults 0 0
Then sudoers would look like this for user bob to have access:
Code:
bob ALL=NOPASSWD: /bin/mount /content
A couple of other things to check is make sure mount point is opened all the way up to 777 before mounting. The actual mount filesystem controls permissions. I've found things can get a little hairy when it isn't opened up.

Sorry if this isn't super helpful.
 
Old 10-07-2011, 03:00 AM   #5
revinary
LQ Newbie
 
Registered: Mar 2011
Posts: 12

Original Poster
Rep: Reputation: 1
Thanks for your reply,

the disk is not in my fstab since it's removable (and should therefore be treated like an external USB drive).

I stumbled across an udev rule on ArchWiki:
Code:
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/host4/*", ENV{UDISKS_SYSTEM_INTERNAL}="0"
is supposed to mark the eSata drive as external but doesn't work for me.

For now, I worked around it by giving me rights to mount internal drives using PolicyKit:
Code:
[Mount a system-internal device]
Identity=*
Action=org.freedesktop.udisks.filesystem-mount-system-internal
ResultActive=yes
Cheers,

rev
 
Old 10-07-2011, 09:25 AM   #6
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
Thanks. This will probably prove useful. Cause I've run into similar errors while trying to mount external drives.
 
  


Reply

Tags
authentication, mount, password, sudo



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "sudo: Can't mkdir /var/run/sudo/%user%: File exists" CNBarnes Linux - Server 7 01-10-2011 04:11 PM
unchecked link between pc user and sudo user on Mint5 how do I get it back,stop laugh Fred Caro Linux - Newbie 2 04-22-2009 08:36 PM
Problem with SUDO : sudo: pam_authenticate: Module is unknown cristoph_ Linux - Software 2 03-02-2009 07:12 PM
Gconf-editor settings not sticking for root, sudo user, or user when run sandaili Fedora 1 07-19-2008 08:31 AM
having a problem mounting a cd-rom in anything but user. Jedi_Jay87 Linux - Newbie 1 03-12-2006 11:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration