Centos7.6下Linux的用户创建并赋予root操作权限

一、添加Linux用户

1.#添加一个名为tody的用户

adduser tody

2.//修改密码

#passwd tody

#Changing password for user myaideal
New UNIX password: 123456 //在这里输入新密码
Retype new UNIX password: //再次输入新密码
passwd: all authentication tokens updated successfully.
 
二:赋予root用户操作权限
修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示:
Allow root to run any commands anywhere
root ALL=(ALL) ALL
tody ALL=(ALL) ALL
修改完毕,现在可以用tody帐号登录,然后用命令 sudo – ,即可获得root权限进行操作。
posted @ 2022-04-14 22:29  Sentinel-163  阅读(282)  评论(0编辑  收藏  举报