用户管理命令集合
useradd
使用命令useradd的过程(不加任何参数)
useradd -D 可以修改新建用户的默认配置值 /etc/default/useradd
usermod 修改用户信息, 和useradd用法差不多
在实际工作中尽量不要使用userdel删除用户,而是采用在/etc/passwd里注释用户的方法,防止用户误删带来的系统及服务的不正常
passwd 可以修改用户密码及密码过期时间等,普通用户只能更改自身的用户密码
注:
root用户修改密码的时候,如果不符合系统密码规则,则给出警告信息,但密码还是生效
而普通用户使用弱密码时,给出警告并不不不生效
su
/etc/sudoers
## Allows people in group wheel to run all commands ## 允许wheel用户组中的用户执行所有命令 %wheel ALL=(ALL) ALL ## Same thing without a password ## 允许wheel用户组中的用户在不输入该用户的密码的情况下使用所有命令 # %wheel ALL=(ALL) NOPASSWD: ALL ## Allows members of the users group to mount and unmount the ## cdrom as root ## 允许users用户组中的用户像root用户一样使用mount、unmount、chrom命令 # %users ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom ## Allows members of the users group to shutdown this system ## 允许users用户组中的用户关闭localhost这台服务器 # %users localhost=/sbin/shutdown -h now ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment) ## 读取放置在/etc/sudoers.d/文件夹中的文件(此处的#不意味着这是一个声明) #includedir /etc/sudoers.d
visudo -c 检测语法
格式 user_name 机器=授权角色 commands
%user_group 机器=授权角色 commands
生产环境中,通常会禁止root远程登陆,不过,系统会为每个运维人员建立一个普通账号,然后根据运维人员的需求,通过sudo控制登陆系统的权限
还可以使用ldap统一认证登陆及授权管理的方式,一站通
(SVN 教程 Apache Subversion 通常被缩写成 SVN,是一个开放源代码的版本控制系统)
(虚拟专用网络(VPN)的功能是:在公用网络上建立专用网络,进行加密通讯。在企业网络中有广泛应用。VPN网关通过对数据包的加密和数据包目标地址的转换实现远程访问。VPN可通过服务器、硬件、软件等多种方式实现。)