Sponsored Content
Special Forums Cybersecurity Remove need for sudo for mount/umount Post 302396107 by Narnie on Wednesday 17th of February 2010 07:15:19 PM
Old 02-17-2010
Quote:
Originally Posted by Corona688
If you're not using sudo, its configuration isn't relevant. sudo options are sudo's alone and don't matter when you don't use it.

If these things are being mounted by hand, could you just alias mount to sudo mount in their .bashrc? Users could thus run 'mount' and the shell would run 'sudo mount'. This is a lot safer than the alternative, i.e. setting the mount binary setuid so it always runs as root!
Ultimately, I want to have this in a script.

As far as not using sudo, I'm confused then. In looking for how to run truecrypt without needing a password, I read that if this is added to the /etc/sudoers

Code:
%admin ALL=NOPASSWD: /usr/bin/truecrypt

then one can run truecrypt without having to type sudo.

This is in fact the case in my setup. If I have this line in sudoers then I can run truecrypt without prefixing it with sudo. If I don't have this line, then truecrypt asks for admin privileges.

To show truecrypt is not aliased :
Code:
$ type truecrypt
truecrypt is hashed (/usr/bin/truecrypt)

Is truecrypt itself calling sudo to mount? If that is the case, then this makes a little more sense. The more I think of it, the more I feel it is likely this way. But still, truecrypt isn't needing a sudo prefix so how can modifying sudoers affect the truecrypt script? Can someone explain? Why don't I have to have sudo in from of truecrypt as in:

Code:
sudo truecrypt -d ; # to dismount all volumes

as evidenced by this result:

Code:
$ truecrypt -t -v -d
Volume "/home/woodnt/.vol/xj9" has been dismounted.
Volume "/home/woodnt/.vol/i5yq" has been dismounted.

Furthermore, why wouldn't it require mount in sudoers rather than truecrypt if truecrypt is using "sudo mount ..."

Bewildered but enjoying learning,
Narnie

---------- Post updated at 06:15 PM ---------- Previous update was at 05:42 PM ----------

BTW, if I have either of the 2 mount/umount combos I listed in my first post in place I get this when trying to run sudo mount ...

Code:
$ sudo mount --bind Dir1 Dir2
[sudo] password for woodnt:

It still wants a password if I prefix it with sudo even though I've tried:

Code:
%admin ALL=NOPASSWD: /usr/bin/mount

and
Code:
%admin ALL=(ALL) NOPASSWD: /usr/bin/mount

Narnie

This shows I'm in admin group:

Code:
$ groups
woodnt adm disk dialout cdrom audio video plugdev lpadmin admin sambashare vboxusers


Last edited by Narnie; 02-17-2010 at 07:53 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Writing a script to mount and umount a drive in Linux

I have a 1 GB jazz drive. The jazz disk is used daily, both at home and at work on my Win 98 Server. So, I have to keep it in vfat format, which is fine because Linux rocks and will read it no problem. :-) However, I can't just stick the disk in the drive and open up the jazz folder in my mnt... (2 Replies)
Discussion started by: wizkid
2 Replies

2. UNIX for Dummies Questions & Answers

solaris 8 admin I text ambiguities on mount and umount

i'm prepping for my midterm, which i will bomb. i am scurrying to finish reading the final chapter before i get down into the review. however, i came across something in chapter 8 - "mounting file systems" that has me really confused. the text says the following: then it goes on to... (2 Replies)
Discussion started by: xyyz
2 Replies

3. Solaris

How to remove sudo program

How to completely uninstall sudo program? Thank u in advance (1 Reply)
Discussion started by: unitipon
1 Replies

4. Linux

How to mount/umount disk from a non-root account

Is it possible to mount a disk from a non-root account? I'm developing a Java application which executes commands in the shell using the java.lang.Runtime.exec api, which runs fine for commands ls, df, etc., but for commands mount and umount, i have problems as I need to be root to eecute these.... (8 Replies)
Discussion started by: brendan76
8 Replies

5. Solaris

mount & umount in sigle-user mode

In Solaris 8, when I boot to single user mode, mount a device and then reboot or init 0, the system unmount it automatically. However, in Solaris 10 it does not seem to do the same. Here is what I did: {0} ok boot -s # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0.... (11 Replies)
Discussion started by: StarSol
11 Replies

6. Shell Programming and Scripting

shell script problem , sudo mount command

cat test.sh sudo mount -t vfat /dev/sda7 /media/Ddrive If i double click the test.sh file and select run in terminal then the terminal prompts for password. How can i avoid typing password? Or if i double click test.sh file and select run then nothing happens. What i'm trying "Double... (3 Replies)
Discussion started by: cola
3 Replies

7. UNIX for Dummies Questions & Answers

Simple way to umount NFS mount in linux

Hello... I've mounted a share using standard nomenclature for the NFS mount command with the following command line: mount -t nfs -o rw {IP address1}:/ /mnt_for_70 / {IP address2}(rw) mnt_for_70 is a mount point I created on {IP address2} I'm confuse and want to be sure I use the... (1 Reply)
Discussion started by: blaine.miller
1 Replies

8. Fedora

What is the right way to mount and umount a usb driver?

I have some questions: 1, I successfully mounted my usb drive with "sudo mount /dev/sdb1 /mnt", but I can't wirte, It says "read-only file system". But I can write it in windows. 2, After I umounted the usb drive the led of it still on, but not blinking. Is it safe to unplug it? How to let it's... (17 Replies)
Discussion started by: vistastar
17 Replies

9. AIX

how to remove sudo access from a user ?

Hello Folks, I need help on removing sudo access on one id but first of all, can i confirm that the user below is having sudo access ? if he did have sudo access, how to remove ? thanks alrsprd3:root-/etc> more sudoers | grep fzcx0l fzcx0l ALL=(ALL) ALL alrsprd3:root-/etc> (2 Replies)
Discussion started by: wingcross
2 Replies

10. HP-UX

Test cases for file system mount/umount performance in HP

Hi Folks, Could anyone please assist me with the what could be the scenarios to test the file system mount/umount performance check in HPUX. Thanks in advance, Vaishey (5 Replies)
Discussion started by: Vaishey
5 Replies
All times are GMT -4. The time now is 03:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy