中二管理员
发布于 2023-02-15 / 265 阅读
0
0

linux 新增用户和赋予sudo权限

记:linux 新增用户命令

useradd -m aaa #新增aaa用户
passwd aaa #修改aaa密码

#赋予aaa账号使用sudo命令
vi /etc/sudoers 

在98行左右增加
## Allow root to run any commands anywhere
root     ALL=(ALL)     ALL
aaa    ALL=(ALL)     ALL

wq!保存

后切换到普通用户执行
sudo /etc/init.d/network restart

评论