ssh登入能自动执行三个特殊文件中的一个:/.bash_profile、 /.bash_login、 /.profile,但只执行最先找到的一个

Ref url:

https://www.jianshu.com/p/5f1036d23ee6

 

用户ssh登入后计算机执行了哪些文件

用户登录时bash首先自动执行系统管理员建立的全局登录script :/ect/profile。然后bash在用户起始目录下按[顺序查找]三个特殊文件中的一个:/.bash_profile、 /.bash_login、 /.profile,但只执行最先找到的一个。
注意不是自动运行.bashrc脚本,而是.profile脚本(通常.profile中设置了.bashrc的执行)。
~.bash_profile 登录时执行
~.bash_logout 注销时执行

猜你喜欢

转载自blog.csdn.net/junmuzi/article/details/88171664