在的.bashrc ssh登录 [英] .bashrc at ssh login

查看:121
本文介绍了在的.bashrc ssh登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我ssh到运行的哈8.04我的Ubuntu的盒子,在我的.bashrc环境变量未设置。

When I ssh into my ubuntu-box running Hardy 8.04, the environment variables in my .bashrc are not set.

如果我做了源.bashrc中,变量设置是否正确,一切都很好。

If I do a source .bashrc, the variables are properly set, and all is well.

怎么来的.bashrc不是在登录时运行?

How come .bashrc isn't run at login?

推荐答案

的.bashrc 当您登录使用SSH没有采购。您需要将源在你的的.bash_profile 是这样的:

.bashrc is not sourced when you log in using SSH. You need to source it in your .bash_profile like this:

if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi

这篇关于在的.bashrc ssh登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆