Centos7 添加用户及设置权限

时间:2020-01-28 16:24:16   收藏:0   阅读:71

一、添加用户


[gau@localhost /]$ su
Password:   # 输入密码
[root@localhost /]# 
[root@localhost /]# useradd testuser
[root@localhost /]#
[root@localhost /]# passwd testuser
Changing password for user testuser.
New password:
BAD PASSWORD: The password is a palindrome
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost /]#

二、给该用户添加root权限

????? ## Allow root to run any commands anywher
????? root ? ALL=(ALL) ?? ALL
????? xxx??? ALL=(ALL) ?? ALL #xxx为新增用户

三、测试

1、普通用户进入

2、#sudo mkdir test(创建的文件夹名)

3、#ls 查看目录

4、#sudo rm -r test ( 删除文件夹)
————————————————
版权声明:本文为CSDN博主「喜欢海呀」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_25046261/article/details/78182536

原文:https://www.cnblogs.com/geoffreygao/p/12238231.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!