为Ubuntu系统添加新的普通用户

创建一个新的普通用户

$ sudo useradd -m meow -s /bin/bash
$ sudo passwd meow
$ sudo adduser meow sudo
$ su meow
  • 创建了可以登录的meow用户并使用/bin/bash作为shell。
  • 设置密码。
  • 为meow用户增加管理员权限。
  • 切换登录用户为meow。

给用户授权

$ groups meow
$ usermod -aG sudo meow
$ visudo
  • 查看meow所在的组。
  • 设置meow权限为superuser。
  • 查看sudoer的文本文件,可以添加meow ALL=(ALL:ALL) ALL为meow设置superuser权限。

删除用户

$ deluser --remove-home meow
  • 删除用户目录

猜你喜欢

转载自blog.csdn.net/MeowingCat/article/details/84134449