CentOS 7 添加用户
一、新建用户并设置密码
adduser name1
passwd name1
Changing password for user name1.
New password: # 输入密码
Retype new password: # 再次输入密码
passwd: all authentication tokens updated successfully
二、授权
chmod u+w /etc/sudoers # 获取修改文件权限
vi /etc/sudoers # 修改文件使用户具有root权限
## Allow root to run any commands anywhere #找到这一行
root ALL=(ALL) ALL
username ALL=(ALL) ALL # 加入内容,使得username 具有root权限
保存退出,username 用户加上 sudo 命令,就可以具有 root 权限。
提示: 如果 sudoers 文件路径不对可以通过 whereis sudoers
查看具体路径
本文标题:CentOS 7 添加用户
本文链接:https://www.haomeiwen.com/subject/mrkpnctx.html
网友评论