sudo vs root
keywords: sudo access sudoize user
Agaric Design's sysadmin explains the world of sudo...
Never ever ever ever give someone root. The better thing to do would to add an account to the sudoers list. Do you know about sudo? It temporarily grants a user superuser abilities, hence S(uper) U(ser) DO. Basically, you add the user to the /etc/sudoers file. The sudo manual suggests using the program "visudo" to edit the list, which as you may have guessed invokes the vi editor. I had no problem using pico or nano, since I abhor both vi and emacs. The format for sudoers is as follows:
<user> <HOST> = <COMMAND LIST>
For example, there is an entry for root in sudoers that looks like:
root ALL = ALL
which means that root can execute all superuser commands on all hosts.
[If you don't have anything against vi, you can use the proper visudo method by logging in as root su root
(if already logged in otherwise) and typing simply visudo
.]
To give -temporary- root privileges, create a new user with its own password, and add it to the sudoers list. Then, after the machine's up and running, remove the user from the sudoers list.
Oh, and so you know, to actually USE sudo, you have to put "sudo" before the command. For example (don't actually follow this example):
sudo shutdown -h now <strong>(again, don't do this)</strong>
Hope this helps!
keywords: sudo access sudoize user
Agaric Design's sysadmin explains the world of sudo...
Never ever ever ever give someone root. The better thing to do would to add an account to the sudoers list. Do you know about sudo? It temporarily grants a user superuser abilities, hence S(uper) U(ser) DO. Basically, you add the user to the /etc/sudoers file. The sudo manual suggests using the program "visudo" to edit the list, which as you may have guessed invokes the vi editor. I had no problem using pico or nano, since I abhor both vi and emacs. The format for sudoers is as follows:
<user> <HOST> = <COMMAND LIST>
For example, there is an entry for root in sudoers that looks like:
root ALL = ALL
which means that root can execute all superuser commands on all hosts.
[If you don't have anything against vi, you can use the proper visudo method by logging in as root su root
(if already logged in otherwise) and typing simply visudo
.]
To give -temporary- root privileges, create a new user with its own password, and add it to the sudoers list. Then, after the machine's up and running, remove the user from the sudoers list.
Oh, and so you know, to actually USE sudo, you have to put "sudo" before the command. For example (don't actually follow this example):
sudo shutdown -h now <strong>(again, don't do this)</strong>
Hope this helps!
Comments
Post new comment