scp in non-interactive sessions problem?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all im new to the list,

Im having a problem when using scp from within an other application and
therefore in non-interactive mode. I continue getting:

Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-with-mic,password).

But I haven't send any password yet...I am suspecting that my shell
produces some unwanted output for the session. As described in , but running

ssh yourhost /usr/bin/true

generates no unwanted output?

Has anyone had similar problems and how did they solve it? Im running OS
X 10.4.x. and bash as default shell.



Re: scp in non-interactive sessions problem?

Quoted text here. Click to load it

The problem is that ssh wants to read the password from its controlling
terminal (ie /dev/tty rather than stdin) but it doesn't have one.
You can either spawn ssh with a controlling tty from your app, set ssh
up to use non-interactive authentication (eg BatchMode=yes) or use an
external command via $SSH_ASKPASS to supply the password to ssh.

The message that ssh outputs in that situation could be better, though.

Darren Tucker (dtucker at
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Re: scp in non-interactive sessions problem?

Thank you, that was very helpful.

Im using Expect to do this, so do I still need to start a tty terminal

I hoped I would be able to do this in a "OS independent" way as long as
scp is in the path, but I guess starting a tty terminal first will not

Non-interactive authentication would work, but starting the ssh-agent
for the pass-phrase would not be too "OS independent".

Any ideas?

thanks in advance


Site Timeline