4

I want to do something like this

ssh [email protected] ./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:

[email protected] password: 

This is the output:

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!

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?

1

1 Answer 1

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 [email protected] ./remote_script.sh
1
  • The -t option seems to do what I want. Thank you. May 4, 2012 at 17:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .