Networking Forums

Networking Forums > Computer Networking > Linux Networking > sudo , nfs mount

Reply
Thread Tools Display Modes

sudo , nfs mount

 
 
BB
Guest
Posts: n/a

 
      02-08-2006, 10:47 AM
Hi,
In my RHEL 4 system, I want to give a normal user permission
so that he/she can mount a nfs partition in one of his directories
inside his home directory.

I tried with SUDO like this:

visudo:

user1 ALL=/bin/mount /user1/home/mnt ,/bin/umount /user1/home/mnt
I checked /sbin/mount and found it "-rwsr-sr-x".

But when the user1 logs in and try to execute
sudo mount -t nfs xx.xx.xx.xx:/mnt/inst mnt

he gets "
Sorry, user user1 is not allowed to execute '/bin/mount -t nfs
xx.xx.xx.xx:/mnt/inst mnt/' as root on VmWare.localdomain."

where m I wrong in setting this up ? please guide. thanks


regards
BB

 
Reply With Quote
 
 
 
 
Robert Harris
Guest
Posts: n/a

 
      02-08-2006, 11:47 AM
BB wrote:
> Hi,
> In my RHEL 4 system, I want to give a normal user permission
> so that he/she can mount a nfs partition in one of his directories
> inside his home directory.
>
> I tried with SUDO like this:
>
> visudo:
>
> user1 ALL=/bin/mount /user1/home/mnt ,/bin/umount /user1/home/mnt
> I checked /sbin/mount and found it "-rwsr-sr-x".
>
> But when the user1 logs in and try to execute
> sudo mount -t nfs xx.xx.xx.xx:/mnt/inst mnt
>
> he gets "
> Sorry, user user1 is not allowed to execute '/bin/mount -t nfs
> xx.xx.xx.xx:/mnt/inst mnt/' as root on VmWare.localdomain."
>
> where m I wrong in setting this up ? please guide. thanks
>
>
> regards
> BB


You don't want to give your user permission to run mount (otherwise
s?he'll be able to mount anything). Do the mounting for user1 as system
administrator and add the mount to /etc/mtab if you always want them to
have their mount.

Robert

 
Reply With Quote
 
Ken K
Guest
Posts: n/a

 
      02-08-2006, 12:05 PM
Robert Harris wrote:

> BB wrote:
>> Hi,
>> In my RHEL 4 system, I want to give a normal user permission
>> so that he/she can mount a nfs partition in one of his directories
>> inside his home directory.
>>
>> I tried with SUDO like this:
>>
>> visudo:
>>
>> user1 ALL=/bin/mount /user1/home/mnt ,/bin/umount /user1/home/mnt
>> I checked /sbin/mount and found it "-rwsr-sr-x".
>>
>> But when the user1 logs in and try to execute
>> sudo mount -t nfs xx.xx.xx.xx:/mnt/inst mnt
>>
>> he gets "
>> Sorry, user user1 is not allowed to execute '/bin/mount -t nfs
>> xx.xx.xx.xx:/mnt/inst mnt/' as root on VmWare.localdomain."
>>
>> where m I wrong in setting this up ? please guide. thanks
>>
>>
>> regards
>> BB

>
> You don't want to give your user permission to run mount (otherwise
> s?he'll be able to mount anything). Do the mounting for user1 as system
> administrator and add the mount to /etc/mtab if you always want them to
> have their mount.
>
> Robert


I have this entry in my fstab which allows them to mount this specific mount
by hand:

192.168.0.5:/export/mp3 /mnt/mp3 nfs
noauto,noatime,rw,user 0 0

(it wrapped due to length)

 
Reply With Quote
 
Chris Davies
Guest
Posts: n/a

 
      02-08-2006, 01:45 PM
Robert Harris <(E-Mail Removed)> wrote:
> You don't want to give your user permission to run mount (otherwise
> s?he'll be able to mount anything).


The OP appears to have thought about that and has attempted to restrict
the mount to specific parameters.

Unfortunately I can't see what's wrong with the original configuration.

Chris
 
Reply With Quote
 
Keith Keller
Guest
Posts: n/a

 
      02-08-2006, 02:56 PM
On 2006-02-08, BB <(E-Mail Removed)> wrote:
>
> I tried with SUDO like this:
>
> visudo:
>
> user1 ALL=/bin/mount /user1/home/mnt ,/bin/umount /user1/home/mnt
> I checked /sbin/mount and found it "-rwsr-sr-x".
>
> But when the user1 logs in and try to execute
> sudo mount -t nfs xx.xx.xx.xx:/mnt/inst mnt
>
> he gets "
> Sorry, user user1 is not allowed to execute '/bin/mount -t nfs
> xx.xx.xx.xx:/mnt/inst mnt/' as root on VmWare.localdomain."


This is the same exact problem you had with your mount set up as a user
mount in /etc/fstab. The user's command doesn't match your sudoers
entry, so sudo rejects it. Try making the commands match.

--keith

--
kkeller-(E-Mail Removed)
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
see X- headers for PGP signature information

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'~$ sudo ifup eth0' does not provide Internet access. Detlef Lechner Linux Networking 3 07-20-2008 09:38 AM
HELP with autofs and NIS: How to override mount options on all mount points? theosib@gmail.com Linux Networking 0 03-04-2006 09:12 PM
SSH, sudo, and host aliases Cooper Blake Linux Networking 1 12-09-2005 07:32 PM
knoppix terminal server: sudo not working on client maxim2k Linux Networking 0 05-09-2005 09:49 AM
NFS mount won't mount at boot, but mount -a works fine. BT Linux Networking 2 09-23-2004 09:37 PM



1 2 3 4 5 6 7 8 9 10 11