1.创建用户

useradd test01

2.为用户创建创建密码

passwd test01

Centos7 创建用户并赋予sudo权限

3.为普通用户赋予sudo权限

① 使用root用户登录系统,首先修改文件/etc/sudoers的写权限(默认为只读,增加写的权限)
  `chmod 640 /etc/sudoers`
② 使用vim编辑文件/etc/sudoers
  `vim /etc/sudoers`
③ 在root后面增加用户名和ALL
  `## Allow root to run any commands anywhere
  root    ALL=(ALL)       ALL
  test01    ALL=(ALL)       ALL
  `
④ wq保存,并将/etc/sudoers改为只读
 `chmod 440 /etc/sudoers`

相关文章:

  • 2022-12-23
  • 2021-06-29
  • 2022-12-23
  • 2021-08-06
  • 2021-12-29
  • 2022-03-07
  • 2022-02-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2021-10-27
  • 2021-09-03
  • 2022-01-12
  • 2022-12-23
相关资源
相似解决方案