Difference between revisions of "Sudo (Русский)"

From ArchWiki
Jump to navigation Jump to search
(page started)
(No difference)

Revision as of 13:05, 2 May 2007

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n links end

Установка

Для установки sudo введите:

pacman -S sudo

Включение sudo для пользователей

Для того чтобы добавить пользователя как пользователя sudo ("sudoer"), отредактируйте /etc/sudoers. Чтобы дать пользователю привилегии root'а, когда он вводит перед командой "sudo", добавьте следующую строку:

USER_NAME   ALL=(ALL) ALL

где USER_NAME - это имя пользователя.

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:

fir<TAB>

and the shell will complete out the command for him as:

firefox


If, however, johndoe is added to the sudoers file and he types:

sudo fir<TAB>

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

Summary

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

See also