配置sudo访问
具體操作步驟
1.首先我們建立一個賬戶,設置密碼
[root@VM_0_13_centos home]# useradd 123 [root@VM_0_13_centos home]# passwd 123 Changing password for user better407. New password: BAD PASSWORD: it is WAY too short BAD PASSWORD: is too simple Retype new password: passwd: all authentication tokens updated successfully.2.運行visudo工具編輯/etc/sudoers 文件
[root@VM_0_13_centos /]# visudo## ## Allow root to run any commands anywhere root ALL=(ALL) ALL## Allows members of the 'sys' group to run networking, software, ## service management apps and more. # %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS## Allows people in group wheel to run all commands #在此添加 # %wheel ALL=(ALL) ALL 123 ALL=(ALL) ALL3.將123賬戶添加到root用戶組
[root@VM_0_13_centos home]# usermod -aG root 1234.執行到su命令切換到新建的用戶123
[root@VM_0_13_centos /]# su 123 bash-4.1$ groups 123 root
轉載于:https://www.cnblogs.com/someone9/p/9567005.html
總結
- 上一篇: .net课堂流水账_20110116
- 下一篇: 简明python教程 答案1