Quick sudo question
Can you set a user to su to another user without a password?
ie, I am logged in as userA I want to su to userB without a password, A colleague is suggesting NOPASSWD in sudoers file, but this just stops you having to enter userA's password, no userB's password? Any help would be appreciated. Ta |
Hi,
You could use su - to go assume root rights which will ask you for your password (if you're in the sudoers list). From there you can su to any user without having to type the password. It's also pretty insecure to assume that level of 'user hopping' when you're not root. One user shouldn't be allowed to switch to another user like that, better is to set permissions on file level. Kind regards, Eric |
You colleague is correct, add something like the following to /etc/sudoers:
Code:
userA ALL=(ALL) NOPASSWD: /bin/su - userB Code:
sudo su - userB cheers |
Thanks guys.
|
Quote:
Thanks for the info; of course you're right. I didn't think that far since we don't have our users connecting on Linux level. Kind regards, Eric |
All times are GMT -5. The time now is 08:59 AM. |