sftp/scp hangs at connection, but ssh is OK

Martin Schröder martin at oneiros.de
Tue Dec 13 10:02:48 EST 2005


On 2005-11-02 16:38:28 +0100, Martin Schröder wrote:
> On 2005-10-30 16:46:11 +0100, Martin Schröder wrote:
> > I've read the FAQ and googled, but I'm still stymied:
> > ssh localhost works, but scp and sftp both hang.

[...]

> > The system is a Suse 8.0 (Linux 2.4.18).
> > 
> > Any idea how to fix this?
> 
> I tried this on secureshell, but got only garbage or pointers to
> the FAQ. The FAQ doesn't help:
> -------------
> > echo +`ssh localhost /bin/true`+
> ++
> -------------

For the archives: I finally found the culprit. I had this in my
.bashrc:
---------------
if test -z "$SSH_AUTH_SOCK" ;
then ssh-agent $SHELL
fi
---------------
This causes ssh-agent to be also called in non-interactive
sessions, which somehow causes scp/sftp to fail.
This works:
---------------
if [ -z "$SSH_AUTH_SOCK" ] && [ -x /usr/bin/ssh-agent ] && /usr/bin/tty -s ;
then ssh-agent $SHELL
fi
---------------

Best
    Martin
-- 
                    http://www.tm.oneiros.de




More information about the openssh-unix-dev mailing list