手动添加用户
添加用户hive 基本组为hive(5000),附加组为mygroup
nano /etc/group
hive:x:5000: # 添加用户组hive
mygroup:x:504:hive # 添加附加组
nano /etc/passwd
hive:x:5000:5000:Hive:/home/hive:/bin/bash
nano /etc/shadow
hive:!!:15765:0:99999:7:::
创建家目录
cp -r /etc/skel/ /home/hive
chown -R hive.hive /home/hive/
chmod -R go= /home/hive/
验证
ls -ld /home/hive/
ls -la/home/hive/
su - hive
#登录hive
openssl passwd
生成加密密码串
openssl passwd -l -salt `12345678`
nano /etc/shadow
umask:遮罩码
创建文件:666-umask
创建目录:777-umask
root 022
普通用户 002
umask
显示当前遮罩码
umask 022
设置遮罩码为022
文件默认不能具有执行权限,如果算得的结果中有执行权限,则将权限加1
文件:666-023=643 自动加1=644
目录:777-023=754 自动加1=755
站在用户登录的角度来,shell的类型

bash的配置文件
全局配置
/etc/profile, /etc/profile.d/*.sh, /etc/bashrc
个人配置
/.bash_profile,./
profile类的文件:
设定环境变量
运行命令或脚本
bashrc类的文件:
设定本地变量
定义命令别名
登录式shell如何读取配置文件?
/etc/profile -->/etc/profile.d/*.sh-->~/.bash_profile--> ~/.bashrc --> /etc/bashrc
非登录式shell如何配置文件?
~/.bashrc --> /etc/basrc --> /etc/profile.d/*.sh
bash. 脚本解释器
用户权限更改

网友评论