admin管理员组

文章数量:1542784

Centos7创建新用户设置密码,并赋予root权限

  • 一、添加用户kubesphere
  • 二、为用户kubesphere设置密码
  • 三、给新用户kubesphere授权sudo命令
  • 四、查看/etc/sudoers
  • 五、实现免密切换到kubesphere

一、添加用户kubesphere

adduser kubesphere

二、为用户kubesphere设置密码

passwd kubesphere
更改用户 kubesphere 的密码 。
新的 密码:
无效的密码: 密码未通过字典检查 - 过于简单化/系统化
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。

三、给新用户kubesphere授权sudo命令

echo 'kubesphere ALL=(ALL) ALL' >> /etc/sudoers

四、查看/etc/sudoers

cat /etc/sudoers

## Allow root to run any commands anywhere
root	ALL=(ALL) 	ALL

## Allows people in group wheel to run all commands
%wheel	ALL=(ALL)	NOPASSWD:ALL

kubesphere ALL=(ALL) ALL

五、实现免密切换到kubesphere

 su kubesphere

本文标签: 新用户权限密码root