一、创建普通用户
1. 创建普通用户
useradd
[root@VM_0_17_centos ~]# useradd user0
2. 为普通用户设置密码
passwd
[root@VM_0_17_centos ~]# passwd user0
Changing password for user user0.
New password:
BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic
Retype new password:
passwd: all authentication tokens updated successfully.
二、编辑 /etc/sudoers
visudo
修改内容:
user0 ALL=(ALL) ALL
完整配置文件内容:
[root@VM_0_17_centos ~]# cat /etc/sudoers
## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.
##
## Examples are provided at the bottom of the file for collections
## of related commands, which can then be delegated out to particular
## users or groups.
##
## This file must be edited with the 'visudo' command.
## Ho

本文介绍了如何在CentOS系统中创建普通用户并进行提权操作,包括使用`useradd`命令创建用户,`passwd`命令设置密码,以及通过编辑`/etc/sudoers`文件赋予用户sudo权限。
最低0.47元/天 解锁文章
1424

被折叠的 条评论
为什么被折叠?



