QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1734|回复: 2

非root用户登陆,不执行~/.bash_profile的问

[复制链接]
发表于 2005-11-11 10:53:29 | 显示全部楼层 |阅读模式
大家好!

我用LFS5.0碰到一个问题,请大家指点。谢谢!

非root用户登陆时系统没有执行~/.bash_profile和~/.bashrc,而是去执行了/etc/profile。
而root用户登陆则执行了/root/.bash_profile 和.bashrc

请问如何使得非root用户执行~/.bash_profile?谢谢!
发表于 2005-11-11 12:29:34 | 显示全部楼层
看看你的那两个文件的权限。
一般不会有这样的问题。。。
回复

使用道具 举报

发表于 2005-11-11 20:47:34 | 显示全部楼层
非root用户登陆时系统没有执行~/.bash_profile和~/.bashrc,而是去执行了/etc/profile。
而root用户登陆则执行了/root/.bash_profile 和.bashrc

一个successful的login使用/bin/login并读取/etc/passwd后---------->执行/etc/profile----->寻找/home/user/.bash_profile

以上是login shell的读取过程.

对于non-login shell (也就是不需要输入username and passwd 马上能得到$, 例如直接在命令行输入bash, 启动xterm等), 先读取父环境的参数然后读取/home/user/.bashrc

同意木木的意见, 楼主应该是用root建立的那个文件的, 权限对users应该是不可读的.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-7-5 18:43 , Processed in 0.085779 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表