Centos5下的用户管理及开通sudo权限
2011-11-18 15:04
344 查看
查看命令
增加用户组
增加用户
更改用户登录权限
修改密码 passwd [username]
删除用户 userdel -r [username]
增加sudo权限
增加 yourusername ALL=(ALL) ALL
修改普通用户的.bash_profile文件,在PATH变量中增加 /sbin:/usr/sbin:/usr/local/sbin:/usr/kerberos/sbin
#列出所有用户 getent passwd #查看在线用户 who #查看用户登录历史记录 last
增加用户组
groupadd groupname
增加用户
useradd username -m -s /sbin/nologin -d /home/username -g groupname -s /sbin/nologin 设置不能登陆 -s /bin/false(老方法) 也行 -d 设置用户主目录 -g 用户组 -m 创建用户目录
Options: -b, --base-dir BASE_DIR base directory for the home directory of the new account -c, --comment COMMENT GECOS field of the new account -d, --home-dir HOME_DIR home directory of the new account -D, --defaults print or change default useradd configuration -e, --expiredate EXPIRE_DATE expiration date of the new account -f, --inactive INACTIVE password inactivity period of the new account -g, --gid GROUP name or ID of the primary group of the new account -G, --groups GROUPS list of supplementary groups of the new account -h, --help display this help message and exit -k, --skel SKEL_DIR use this alternative skeleton directory -K, --key KEY=VALUE override /etc/login.defs defaults -l, --no-log-init do not add the user to the lastlog and faillog databases -m, --create-home create the user's home directory -M, --no-create-home do not create the user's home directory -N, --no-user-group do not create a group with the same name as the user -o, --non-unique allow to create users with duplicate (non-unique) UID -p, --password PASSWORD encrypted password of the new account -r, --system create a system account -s, --shell SHELL login shell of the new account -u, --uid UID user ID of the new account -U, --user-group create a group with the same name as the user -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
更改用户登录权限
#打开登录权限 usermod -s /bin/bash username #禁用用户登录权限 usermod -s /sbin/nologin username #更换用户组 usermod -G groupname username 关闭用户账号: passwd username –l 重新释放: passwd username –u
修改密码 passwd [username]
删除用户 userdel -r [username]
增加sudo权限
visudo -f /etc/sudoers
增加 yourusername ALL=(ALL) ALL
修改普通用户的.bash_profile文件,在PATH变量中增加 /sbin:/usr/sbin:/usr/local/sbin:/usr/kerberos/sbin
更改用户登录权限
相关文章推荐
- Linux用户管理之sudo权限(visudo)
- Sudo 用户权限管理
- LFCS 系列第八讲:管理用户和用户组、文件权限和属性以及启用账户 sudo 访问权限
- 使用sudo对用户进行权限管理
- day13:权限管理su/sudo及限制root用户登录
- centos用户权限管理--su与sudo
- linux用户管理(2)----修改用户模式(usermod,sudo权限等)
- linux用户管理(2)----修改用户模式(usermod,sudo权限等)
- CentOS用户权限管理--su与sudo
- 普通用户开通sudo权限:xxx is not in the sudoers file.This incident will be reported.的解决方法
- Sudo 用户权限管理
- 普通用户开通sudo权限:xxx is not in the sudoers file.This incident will be reported.的解决方法
- Linux(ubuntu)用户权限管理--赋予用户sudo权限
- Linux(ubuntu)用户权限管理--赋予用户sudo权限
- Linux(ubuntu)用户权限管理--赋予用户sudo权限
- LFCS 系列第八讲:管理用户和用户组、文件权限和属性以及启用账户 sudo 访问权限
- linux-Ubuntu用户及权限管理
- ORACLE用户权限管理笔记整理
- ylmf3.0 分配修改登录root用户管理权限的方法
- 多个业务子系统的集中统一管理用户权限,SQL脚本批量事务运行的参考代码