正常电脑使用或者服务器维护中,我们一般不直接使用
root
账号,如果你现在只有一个root
账号可以通过下面命令新建一个用户:useradd -m steven //steven 是我的用户名
然后通过下面命令设置密码:
passwd steven //为刚创建的用户设置密码
把普通用户增加到
sudo
组 通常使用两种方法:第一种: 修改
/etc/sudoers
文件... # User privilege specification root ALL=(ALL:ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL //增加属于自己的用户名 ...
**第二种:直接执行命令添加用户到
sudo
**usermod -a -G sudo steven //注意改成你自己的用户名
作者:owl
链接:http://www.jianshu.com/p/2400203bf555
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
添加普通用户到 sudo 组
最新推荐文章于 2024-03-28 19:23:44 发布