300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > Ubuntu 新建用户并赋予权限

Ubuntu 新建用户并赋予权限

时间:2020-10-24 17:50:50

相关推荐

Ubuntu 新建用户并赋予权限

在 ubuntu 服务器上添加一个用户,并赋予权限。

文章目录

新建用户权限管理

新建用户

Add a new user (testis the user name). We often use the second command. Use-rto create a system account,-mto create the user’s home directory,-sto specify the login shell of the new account. You can use check file/etc/passwdto verify.

useradd testsudo useradd -r -m -s /bin/bash test

Set password for the user

passwd test

Delete this user

userdel test

权限管理

To usesudo -i. First, use commandsudo chmod +w /etc/sudoersto change the property of the file. Then addyour_account_nameALL=(ALL:ALL) ALL, thensudo chmod -w /etc/sudoersreover. see

Ubuntu 18.04下创建新用户/目录、修改用户权限及删除用户的方法 - 云外博客 | 步入云端探索未知奥秘

If you want to add your new account to the sudo (Super User do) group.

sudo usermod -a -G sudo liyp

But this is unnecessary, so use the command to remove it.

gpasswd -d username groupname

Add user into sudo

Remove user out of group

[root@localhost ~]#分别代来表:

1、用户名:root

2、主机名:localhost

3、当前路径:~当前用户的home目录

4、权限源标志位:# or $

Another link, I find that it contains all the contents above.

Ubuntu 18.04下创建新用户/目录、修改用户权限及删除用户的方法 - 云外博客

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。