1、增加用户
首先用adduser
敕令增加一个普通用户,敕令以下:
#adduser tommy //增加一个名为tommy的用户 #passwd tommy //修正暗码 Changing password for user tommy. New UNIX password: //在这里输入新暗码 Retype new UNIX password: //再次输入新暗码 passwd: all authentication tokens updated successfully.
免费视频教程引荐:linux视频教程
2、给予root权限
要领一: 修正 /etc/sudoers
文件,找到下面一行,把前面的解释(#)去掉
## Allows people in group wheel to run all commands %wheel ALL=(ALL) ALL
然后修正用户,使其属于root组(wheel),敕令以下:
#usermod -g root tommy
修正终了,如今可以用tommy帐号登录,然后用敕令 su -
,即可取得root权限举行操纵。
要领二: 修正 /etc/sudoers
文件,找到下面一行,在root下面增加一行,以下所示:
## Allow root to run any commands anywhere root ALL=(ALL) ALL tommy ALL=(ALL) ALL
修正终了,如今可以用tommy帐号登录,然后用敕令 su -
,即可取得root权限举行操纵。
相干文章教程分享:linux教程
以上就是linux中怎样增加用户并给用户root权限的细致内容,更多请关注ki4网别的相干文章!