问题一:什么是 nogin shell 和 non-login shell
进入/etc/shells中可用的shell(带有nologin的shell是不可用的,和non-login不是一回事),需要输入 帐号 和 密码;
non-login shell:
当用户通过 帐号 和 密码登录系统(echo $$ 可以查看当前shell的PID),
此时在命令行输入某个shell(如/bash/csh)进入新的shell(echo $$ 可以查看新/当前shell的PID)
通常进入这个新的shell不需要帐号和密码,我们称此shell为non-login shell.问题二:login shell 和 non-login shell 有什么不同?
以/bin/bash为例,login shell 会读取 /etc/profile 和 ~/.bash_profile 或 ~/.bash_login 或 ~/.profile 这2个文件。
备注:只会读取~/.bash_profile 或 ~/.bash_login 或 ~/.profile 这会按以上顺序读取这3个配置文件中的一个,
第一个~/.bash_profile存在时就不会读取其它的配置文件,不存在时才会往下读取(是不是和oracle数据库启动时读取spfile/pfile配置文件一样)
以/bin/bash为例,non-login shell 会读取 ~/.bashrc 配置文件。
----以上是shell读取配置文件的整体流程,具体每个shell读取了那些文件或脚本(配置文件中可以呼叫/引入/读取其它文件)
需要查看配置文件的具体内容。