免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4039 | 回复: 3
打印 上一主题 下一主题

ssh登录后PATH的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-09-08 17:49 |只看该作者 |倒序浏览
你好,我想问个ssh登录的问题。

我现在的问题是
ssh user@host.com jps
返回jps找不到命令
但是若先ssh user@host.com,登录上去后再jps,就可以运行。

我现在需要在本机调用user@host.com上jps命令结果。请各位指点。

谢谢。

论坛徽章:
0
2 [报告]
发表于 2010-09-08 17:55 |只看该作者
回复 1# hdc1112_cu


    我试着没问题,有执行权限么?

论坛徽章:
0
3 [报告]
发表于 2010-09-08 18:25 |只看该作者
Administrator@20100326-1501 ~
$ ssh dachuan@202.114.10.130 jps
dachuan@202.114.10.130's password:
bash: jps: command not found

Administrator@20100326-1501 ~
$ ssh dachuan@202.114.10.130
dachuan@202.114.10.130's password:
Permission denied, please try again.
dachuan@202.114.10.130's password:
Permission denied, please try again.
dachuan@202.114.10.130's password:
Last login: Wed Sep  8 09:43:45 2010 from web1
[dachuan@WEB1 ~]$ jps
10441 Jps
8236 SecondaryNameNode
[dachuan@WEB1 ~]$


截图是这样的。 我觉得是PATH问题。

论坛徽章:
0
4 [报告]
发表于 2010-09-08 18:52 |只看该作者
我想问一下,ssh登录到服务器上后,是不是执行.bash_profile啊。我觉得没执行


因为:
Administrator@20100326-1501 ~
$ ssh dachuan@202.114.10.130 "source ~/.bash_profile && jps"
dachuan@202.114.10.130's password:
10520 Jps
8236 SecondaryNameNode

Administrator@20100326-1501 ~
$


谁能解释并给个完整方法吧,谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP