4

I want to do something like this

ssh user@remote-domain.com ./remote_script.sh

Contents of remote_script.sh

#!/bin/bash
hg pull

This example is much simpler than what I am actually doing. I know I can pass shell commands directly over ssh, but assume I want to run a remote script. Also I know Mercurial has hooks, but ignore that as well, I am only using Mercurial as an example here for brevity.

This is what I expect to happen, a password prompt for the user:

user@repository-domain.com password: 

This is the output:

ssh user@remote-domain.com ./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!

The remote shell session seems to be feeding something to the password input prompts and failing after 3 automated tries. I would really like the prompt to reach my local shell session. Perhaps that isn't possible.

I don't want to give the remote server key authentication to the repository, I'd prefer the user be prompted each time. Is there any way to do this?

9

It's hard to figure out what exactly is going on from this post. Is the password prompt being printed by the hg command (I'm not familiar with hg)?

I recommend you try adding the -t option to ssh:

ssh -t user@remote-domain.com ./remote_script.sh
  • The -t option seems to do what I want. Thank you. – Matthew Chambers May 4 '12 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.