Re: scp problems: lost connection (478 Views)
Super Advisor
Posts: 1,155
Registered: ‎05-20-2005
Message 1 of 2 (520 Views)

scp problems: lost connection

[ Edited ]


Cannot get scp to work.     Any idea what this error means? 11.31.


/var/tmp $ scp -vvv a root@xxx.xx.xx.xx:/var/tmp Executing: program /opt/ssh/bin/ssh host xxx.xx.xx.x, user root, command scp -v -t /var/tmp lost connection


P.S. This thread has been moved from  HP-UX>System Administration to HP-UX > networking. -HP Forum Moderator

Honored Contributor
Posts: 6,271
Registered: ‎12-02-2001
Message 2 of 2 (478 Views)

Re: scp problems: lost connection

OpenSSH-based versions of scp use the ssh command as a pipeline to pass the data to/from another host.

(Commercial SSH implementations might use the SFTP protocol instead.)

The scp command says it's running this ssh command:

/opt/ssh/bin/ssh root@xxx.xx.xx.x scp -v -t /var/tmp

 In effect, it's running another copy of the scp command in the remote host, with special options that allow the remote scp process to accept data from the local one.


The error message is simply "lost connection". It means that the underlying SSH connection failed in some way.


So, you might want to try to establish a similar SSH connection manually.


What is the output if you run "ssh -vvv root@xxx.xx.xx.xx" ?


If the SSH connection works, then the remote scp command might not be located in the $PATH for the non-interactive login. (Non-interactive logins sometimes have a simpler $PATH setting than the interactive ones.)

While still logged in to the remote host, run "which scp" to see where the scp command is located on the remote host.

Then logout from the remote host.


Run "ssh root@xxx.xx.xx.xx echo \$PATH" to see the $PATH setting for non-interactive logins on the remote host.

If the setting does not include the directory where the remote scp command was located, the problem is that the remote non-interactive login session fails to find the scp command.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.