Linux配置sudo
生活随笔
收集整理的這篇文章主要介紹了
Linux配置sudo
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?檢查是否已經安裝sudo
[root@localhost ~]# ls -l `whereis sudo` ---s--x--x. 2 root root 186800 Sep ?1 ?2010 /usr/bin/sudo -rw-r--r--. 2 root root ?11296 Sep ?1 ?2010 /usr/share/man/man8/sudo.8.gz 若沒安裝,自行下載rpm或者源碼進行安裝 增加配置 允許rhel 不輸入密碼就 sudo到root [root@localhost ~]# grep NOPASSWD /etc/sudoers # %wheel ALL=(ALL) NOPASSWD: ALL rhel ?ALL=(ALL) ? ? ? NOPASSWD: ALL 驗證: [root@localhost ~]# id uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 [root@localhost ~]# su - rhel [rhel@localhost ~]$ id uid=500(rhel) gid=500(rhel) groups=500(rhel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 [rhel@localhost ~]$ sudo -u root -s [root@localhost rhel]# id uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 [root@localhost rhel]# sudo -l Matching Defaults entries for root on this host: requiretty, always_set_home, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS", env_keep+="MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE", env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES", env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE", env_keep+="LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY", secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin User root may run the following commands on this host: (ALL) ALL 初略配置完畢!轉載于:https://blog.51cto.com/6876163/1167020
總結
以上是生活随笔為你收集整理的Linux配置sudo的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Vim的配置
- 下一篇: js 操作cookies 方法