【问题标题】:How to modify PATH for non-interactive SSH call in RHEL 5?如何在 RHEL 5 中修改非交互式 SSH 调用的 PATH?
【发布时间】:2012-08-11 03:51:18
【问题描述】:

我正在尝试修改我的 SSH 服务器的 PATH 变量,例如非交互式 shell 命令 ssh myserver.com 'echo $PATH' 返回所需的路径。我尝试修改 ~/.bashrc 和 ~/.profile 文件,但它们仅在我以交互方式登录服务器时修改 PATH,即ssh myserver.com

我可以在 RHEL5 中更改此行为吗?

【问题讨论】:

标签: unix ssh redhat rhel5


【解决方案1】:

~/.bash_profile 是您要放置这些变量的位置。我不相信 bash 使用 ~/.profile (我相信它被 csh 和 tcsh 使用)

【讨论】:

    猜你喜欢
    • 2011-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多