Operating System - HP-UX
1833588 Members
3975 Online
110061 Solutions
New Discussion

Re: sftp problem at hp server

 
SOLVED
Go to solution
Jun Zhang_4
Regular Advisor

sftp problem at hp server

scp problemserver:/etc/hosts /tmp
sh: scp: not found.
ssh problemserver which scp
no scp in $prefix/bin $prefix/sbin /sbin /usr/sbin /usr/bin
problemserver:root:/# which scp
/usr/local/bin/scp
ssh problemserver echo $PATH
/usr/local/bin is not in the path, and the paths are different from the one seen in the error message.
problemserver:root:/# echo $PATH
/usr/local/bin is in the path, and the paths are different from the one in the error message and from the remote echo $path result.
Using scp at the problemserver as a client is fine.

Jun Z


Food lover
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: sftp problem at hp server

/usr/local/bin/scp

That is not a standard installation location.

This looks very much like an environment variable issue.

Keep looking at the $PATH variable.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sridhar Bhaskarla
Honored Contributor

Re: sftp problem at hp server

Hi Jun Z,

scp problemsever:/etc/hosts /tmp
^

The system on which you are executing 'scp' doesn't seem to have it in it's path. I meant client not the problemserver. All problemserver does is to respond with it's sshd daemon. Instead of doing 'ssh problemserver which scp' do

which scp

This will show scp on the local system. If it doesn't show, then either you have to fix the path or the local system (not the problemserver) doesn't have it installed.

Try

/usr/local/bin/scp problemserver:/etc/hosts /tmp


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Jun Zhang_4
Regular Advisor

Re: sftp problem at hp server

This is openssh-3.7.1p2.
problemserver:> which scp
/usr/local/bin/scp
client:> ssh problemserver which scp
not found
as in my original question (root user is all that involved).

Jun
Food lover
Sridhar Bhaskarla
Honored Contributor
Solution

Re: sftp problem at hp server

Hi,


ssh is compiled with a default path ( a compiler option). If you run which remotely, only that path will be used. If /usr/local/bin is not part of that path then your 'ssh problemserver which scp' will not return anything.

Once you login to the problemserver, the session will inherit the PATH set in the system by /etc/PATH,/etc/profile and your .profile. So 'which scp' will show you the result.

So, I run 'ssh otherserver which ssh', I get the following
/opt/openssh2/bin/ssh

I have "/usr/bin /bin /usr/sbin /sbin /opt/openssh2/bin" in my sshd's default path. So, I got the response back.

ssh otherserver which gzip
no gzip in /usr/bin /bin /usr/sbin /sbin /opt/openssh2/bin

Since /usr/contrib/bin is not in sshd's default path, I got the error.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try