Difference between revisions of "Sudo"
m (i18n links added)
|Line 4:||Line 4:|
Revision as of 13:04, 2 May 2007
To install Sudo:
pacman -S sudo
Enabling sudo for Users
To add a user as a sudo user (a "sudoer"), edit /etc/sudoers. To give the user full root privileges when he/she precedes a command with "sudo", add the following line:
USER_NAME ALL=(ALL) ALL
where USER_NAME is the username of the individual.
Enabling Tab-Completion for sudo Users
Tab-completion, by default, will not work when a user is initially added to the sudoers file. For example, normally johndoe only has to type:
and the shell will complete out the command for him as:
If, however, johndoe is added to the sudoers file and he types:
the shell will do nothing.
To ensure that tab completion for binary executables (such as firefox) are retained when sudo is used, add the following line to /home/USER_NAME/.bashrc:
complete -c sudo
To ensure that tab completion for regular files (such as /etc/X11/xorg.conf) are retained when sudo is used, add the following line to /home/USER_NAME/.bashrc:
complete -f sudo
To summarize, the following setup will satisfy most individuals, where USER_NAME is the individual's username:
1. pacman -S sudo 2. add "USER_NAME ALL=(ALL) ALL" to /etc/sudoers 3. add "complete -cf sudo" to /home/USER_NAME/.bashrc