scp in non-interactive sessions problem? - SSH

This is a discussion on scp in non-interactive sessions problem? - SSH ; 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). ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: scp in non-interactive sessions problem?

  1. scp in non-interactive sessions problem?

    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
    http://www.openssh.com/faq.html#2.9, 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.

    Thanks

    Jens

  2. Re: scp in non-interactive sessions problem?

    On 2006-08-21, Jens K S wrote:
    > 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
    > http://www.openssh.com/faq.html#2.9, but running


    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 zip.com.au)
    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.

  3. 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
    first?

    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
    work...hmm.

    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

    Jens

+ Reply to Thread