-
添加用户
useradd [选项] 用户名
//其中 [选项],可省略。eg:useradd test
添加test用户- 添加
-g
参数,用于指定用户组,如下例所示 -
useradd -g grp_1 test
//新建test用户并增加到grp_1工作组
- 添加
-
设置密码
passwd 用户名
,eg:passwd test
为test用户设置密码。
在设置密码时,如果设置的密码少于8个长度,会有BAD PASSWORD: The password is shorter than 8 characters
的提示,可以忽略该提示,继续设置密码。 -
建立工作组
groupadd grp_1
//新建grp_1工作组 -
查看用户所在的组
-
groups
查看当前用户所属的组 -
groups [user1] [user2]
查看user1、user2所属的组
-
-
为用户添加sudo权限
使用vim /etc/sudoers
打开 suduers文件,找到root ALL=(ALL) ALL
,对其进行复制,修改为用户名 ALL=(ALL) ALL
。接上例所示,为test ALL=(ALL) ALL
。
Linux创建用户指定密码、组、sudo权限
原创
©著作权归作者所有:来自51CTO博客作者donaldsy的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Linux线程是如何创建的Linux
-
linux如何为已创建的用户设置Home目录
文件(在大多数Linux系统中)来更改用户的Home目录路径。请谨慎操作,确保不要破坏文件格式。一般情况下,
运维 linux 用户名 用户信息 生产环境 -
sudo用户创建home目录 使用sudo创建文件
Linux Sudo的使用 Sudo是允许系统管理员让普通用户执行一些或者全部的root命令的一个工具,如halt,reboot,su等等。这样不仅减少了root用户的登陆和管理时间,同
sudo用户创建home目录 配置文件 系统管理员 重定向 -
spring 事务读已提交
Spring框架Spring事务Spring事务的概述Spring事务管理高层抽象主要包括3个接口PlatformTransactionManager:事务管理器TransactionDefinition:事务定义信息(隔离、传播、超时、只读)TransactionStatus:事务具体运行状态 <1>PlatformTransactionManager事务管理器:不同的持
spring 事务读已提交 java手动提交事务 mysql 不同连接的事务 会嵌套 隔离级别 不可重复读