Web Presence
| Passwordless su commands |
|
|
|
| Written by JLangbridge |
| Monday, 27 April 2009 13:47 |
|
On some machines, it can be useful for some users to run specific commands as root, and to not have a root password, or any sort of password for that matter. I had a netbook where I needed the user to be able to restart or halt his computer without any password, and without any form of authentication. To do this, we need to edit the su user configuration file, so type: sudo visudo This opens up an editor and shows the contents of the sudoers file. Add the following line: user ALL=NOPASSWD:/sbin/halt, /sbin/reboot The user "user" can now run "su halt" and "su reboot" without being asked for a password. This can, of course, be applied to other commands, just separate them with a comma, and don't forget to use entire paths. |
| Last Updated on Monday, 29 June 2009 20:32 |





Comments
I needed it. Thanks!
RSS feed for comments to this post