我想做这样的事情
ssh [email protected] ./remote_script.sh
remote_script.sh的内容
#!/bin/bash
hg pull
这个例子比我实际做的要简单得多。我知道我可以直接通过ssh传递shell命令,但是假设我想运行一个远程脚本。我也知道Mercurial有很多问题,但也请忽略,我仅以Mercurial为例。
这是我希望发生的情况,为用户提供密码提示:
[email protected] password:
这是输出:
ssh [email protected] ./remote_script.sh
remote: Permission denied, please try again.
remote: Permission denied, please try again.
remote: Permission denied (publickey,password).
abort: no suitable response from remote hg!
远程Shell会话似乎在向密码输入提示提供内容,并且在3次自动尝试后失败了。我真的很想看到我的本地Shell会话的提示。也许那是不可能的。
我不想为存储库提供远程服务器密钥身份验证,我希望每次都提示用户。有什么办法吗?
很难弄清楚这篇文章到底是怎么回事。是否通过hg命令打印密码提示(我对hg不熟悉)?
我建议您尝试将-t
选项添加到ssh:
ssh -t [email protected] ./remote_script.sh
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句