I virtually never use sudo as I simply su to root and do what's needed.
However I want to do a mount in a shell script that runs as me rather than root and the safest way to do it would seem to be to all 'me' to sudo a mount command. However I can't get it to work with no password, what I have in the sudoers file is:-
chris home = NOPASSWD: /sbin/mount chris home = NOPASSWD: /sbin/umount
... but it's still prompting me for a password when I do 'sudo mount //bla/bla bla'. So, what am I doing wrong?
On Sun, Feb 25, 2007 at 06:52:00PM +0000, Eur Ing Chris Green wrote:
I virtually never use sudo as I simply su to root and do what's needed.
However I want to do a mount in a shell script that runs as me rather than root and the safest way to do it would seem to be to all 'me' to
oops, that's "... allow me ...".
sudo a mount command. However I can't get it to work with no password, what I have in the sudoers file is:-
chris home = NOPASSWD: /sbin/mount chris home = NOPASSWD: /sbin/umount
... but it's still prompting me for a password when I do 'sudo mount //bla/bla bla'. So, what am I doing wrong?
-- Chris Green
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
Hi Chris,
My sudo line is:
rob ALL = ALL, NOPASSWD: /opt/xfce4/libexec/xfsm-shutdown-helper
which prompts me for a password, except when running xfsm-shutdown-helper.
As I recall when trying to set this up to work right, the order of the commands is quite important. I'm guessing you've got a chris ALL = ALL line somewhere in the file.
Rob.
On 25/02/07, Eur Ing Chris Green cl@isbd.net wrote:
I virtually never use sudo as I simply su to root and do what's needed.
However I want to do a mount in a shell script that runs as me rather than root and the safest way to do it would seem to be to all 'me' to sudo a mount command. However I can't get it to work with no password, what I have in the sudoers file is:-
chris home = NOPASSWD: /sbin/mount chris home = NOPASSWD: /sbin/umount
... but it's still prompting me for a password when I do 'sudo mount //bla/bla bla'. So, what am I doing wrong?
-- Chris Green
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
On Sun, Feb 25, 2007 at 07:12:42PM +0000, Rob Page wrote:
On 25/02/07, Eur Ing Chris Green cl@isbd.net wrote:
I virtually never use sudo as I simply su to root and do what's needed.
However I want to do a mount in a shell script that runs as me rather than root and the safest way to do it would seem to be to all 'me' to sudo a mount command. However I can't get it to work with no password, what I have in the sudoers file is:-
chris home = NOPASSWD: /sbin/mount chris home = NOPASSWD: /sbin/umount
... but it's still prompting me for a password when I do 'sudo mount //bla/bla bla'. So, what am I doing wrong?
Hi Chris,
My sudo line is:
rob ALL = ALL, NOPASSWD: /opt/xfce4/libexec/xfsm-shutdown-helper
which prompts me for a password, except when running xfsm-shutdown-helper.
As I recall when trying to set this up to work right, the order of the commands is quite important. I'm guessing you've got a chris ALL = ALL line somewhere in the file.
No, the only other line in the file is the default:-
root ALL=(ALL) ALL
As I said I don't generally see the point of sudo for command line use, just become root and do what you need to do, with a prompt that flags you that you are root you shouldn't forget. (It's maybe a heritage of having to do it this way in the past so I am very wary when I am root)
On Sun, Feb 25, 2007 at 07:20:08PM +0000, Eur Ing Chris Green wrote:
On Sun, Feb 25, 2007 at 07:12:42PM +0000, Rob Page wrote:
On 25/02/07, Eur Ing Chris Green cl@isbd.net wrote:
I virtually never use sudo as I simply su to root and do what's needed.
However I want to do a mount in a shell script that runs as me rather than root and the safest way to do it would seem to be to all 'me' to sudo a mount command. However I can't get it to work with no password, what I have in the sudoers file is:-
chris home = NOPASSWD: /sbin/mount chris home = NOPASSWD: /sbin/umount
... but it's still prompting me for a password when I do 'sudo mount //bla/bla bla'. So, what am I doing wrong?
Hi Chris,
My sudo line is:
rob ALL = ALL, NOPASSWD: /opt/xfce4/libexec/xfsm-shutdown-helper
which prompts me for a password, except when running xfsm-shutdown-helper.
As I recall when trying to set this up to work right, the order of the commands is quite important. I'm guessing you've got a chris ALL = ALL line somewhere in the file.
No, the only other line in the file is the default:-
root ALL=(ALL) ALL
As I said I don't generally see the point of sudo for command line use, just become root and do what you need to do, with a prompt that flags you that you are root you shouldn't forget. (It's maybe a heritage of having to do it this way in the past so I am very wary when I am root)
Aaarrrggghhh!!
I'm being very silly. The password prompt when I do:-
sudo smbmount //chris/C xp
is the password for mounting the XP file system (i.e. the XP password) not one from sudo!
Sorry for the noise folks.
On 25-Feb-07 Eur Ing Chris Green wrote:
[...] As I said I don't generally see the point of sudo for command line use, just become root and do what you need to do, with a prompt that flags you that you are root you shouldn't forget. (It's maybe a heritage of having to do it this way in the past so I am very wary when I am root)
Indeed! And so say all of us (over a certain age ... )!
Today I was trying the live CD of PCLinixOS -- see:
and in this respect it had a neat little feature:
As well as the usual "#" prompt (which we oldies are hypersensitive to anyway), the whole root prompt line is shown in BRIGHT RED on the screen!
No doubt there's a bit of ANSI trickery behind it (I didn't follow it up at the time), but it should be simple enoigh to implement for anyone who feels paranoid about their absentmindedness.
Best wishes to all, Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) ted.harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 25-Feb-07 Time: 22:22:30 ------------------------------ XFMail ------------------------------
Ted,
Link to ANSI trickery:
http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
Rob.
On 25/02/07, Ted Harding ted.harding@nessie.mcc.ac.uk wrote:
On 25-Feb-07 Eur Ing Chris Green wrote:
[...] As I said I don't generally see the point of sudo for command line use, just become root and do what you need to do, with a prompt that flags you that you are root you shouldn't forget. (It's maybe a heritage of having to do it this way in the past so I am very wary when I am root)
Indeed! And so say all of us (over a certain age ... )!
Today I was trying the live CD of PCLinixOS -- see:
and in this respect it had a neat little feature:
As well as the usual "#" prompt (which we oldies are hypersensitive to anyway), the whole root prompt line is shown in BRIGHT RED on the screen!
No doubt there's a bit of ANSI trickery behind it (I didn't follow it up at the time), but it should be simple enoigh to implement for anyone who feels paranoid about their absentmindedness.
Best wishes to all, Ted.
E-Mail: (Ted Harding) ted.harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 25-Feb-07 Time: 22:22:30 ------------------------------ XFMail ------------------------------
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
On 25-Feb-07 Rob Page wrote:
Ted,
Link to ANSI trickery:
http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
Rob.
Nice link, Rob! Nicer still when you step up one to
http://tldp.org/HOWTO/Bash-Prompt-HOWTO
and even nicer up one further to
Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) ted.harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 25-Feb-07 Time: 22:39:02 ------------------------------ XFMail ------------------------------