linux的runuser命令
linux的runuser命令
Linux下runuser命令不太經(jīng)常用到,我們需要了解他的用法即可。下面由學(xué)習(xí)啦小編為大家整理了linux下runuser命令的相關(guān)知識(shí),希望對(duì)大家有幫助!
linux的runuser命令詳解
runuser --help
用法:runuser [選項(xiàng)]... [-] [用戶 [參數(shù)]... ]
Change the effective user id and group id to that of USER. Only session PAM
hooks are run, and there is no password prompt. This command is useful only
when run as the root user. If run as a non-root user without privilege
to set user ID, the command will fail as the binary is not setuid.
As runuser doesn't run auth and account PAM hooks, it runs with lower overhead
than su.
-, -l, --login make the shell a login shell, uses runuser-l
PAM file instead of default one
-g --group=group specify the primary group
-G --supp-group=group specify a supplemental group
-c, --command=COMMAND pass a single COMMAND to the shell with -c
--session-command=COMMAND pass a single COMMAND to the shell with -c
and do not create a new session
-f, --fast pass -f to the shell (for csh or tcsh)
-m, --preserve-environment do not reset environment variables
-p same as -m
-s, --shell=SHELL run SHELL if /etc/shells allows it
--help 顯示此幫助信息并退出
--version 顯示版本信息并退出
單獨(dú)的"-"選項(xiàng)隱含了-l。如果不指定用戶,則假設(shè)其為root。
請(qǐng)向bug-coreutils@gnu.org 報(bào)告runuser 的錯(cuò)誤
GNU coreutils 項(xiàng)目主頁(yè):<http://www.gnu.org/software/coreutils/>
GNU 軟件一般性幫助:<http://www.gnu.org/gethelp/>
請(qǐng)向<http://translationproject.org/team/zh_CN.html> 報(bào)告runuser 的翻譯錯(cuò)誤
要獲取完整文檔,請(qǐng)運(yùn)行:info coreutils 'runuser invocation'
linux的runuser命令使用實(shí)例
# For SELinux we need to use 'runuser' not 'su'
if [ -x "/sbin/runuser" ]; then
SU="/sbin/runuser -s /bin/sh"
else
SU="/bin/su -s /bin/sh"
fi