'user' not in the sudoers file
Hi,
As I try to run Code:
sudo /bin/su -lc ..... Code:
'user' not in the sudoers file -- Thomas |
You don't need sudo to run su. Just omit the sudo.
|
But from another machine I see in the sudores file followings:
Code:
... |
Read
Code:
man sudoers |
Quote:
But I will run the /bin/su not manually but from a script. Since I will be asked for the password by running /bin/su and the script can not automatically input the password, so I have to set the 'user' in /bin/sudores. |
Didn't thought about that. Setting up sudo to run su without a password is a real security risk, the user that is allowed to do that is practically root, be aware of that.
|
You can su in a script - we do it here all the time.
You do have to run the script as a user who can su without password, however (or use Expect). An easy way to do the same basic thing without running as root is to use ssh with passwordless login (via keys). Then just have the script call "ssh user@host command" |
All times are GMT -5. The time now is 04:43 PM. |