Operating System - HP-UX
1751973 Members
5551 Online
108784 Solutions
New Discussion юеВ

Re: ssh sftp scp on the server does not work

 
SOLVED
Go to solution
Venky...
Advisor

ssh sftp scp on the server does not work

#uname -a
HP-UX cambodia B.11.11 U 9000/800 3177049593 unlimited-user license

#model
9000/800/rp8420

The default path /opt/ssh/PA-RISC2.0/bin does not work. It works only for sftp.
The other path /opt/ssh/PA-RISC1.1/bin works only for ssh, but it does not work for sftp, scp.

=======path which does not work========
#/opt/ssh/PA-RISC2.0/bin/ssh -V
Usage: rlogin host [ -ex ] [ -l username ] [ -8 ]

#/opt/ssh/PA-RISC2.0/bin/sftp tay
Connecting to tay...
Usage: rlogin host [ -ex ] [ -l username ] [ -8 ]
Connection closed

#/opt/ssh/PA-RISC2.0/bin/scp /tmp/hi tay:/tmp/
rcp: shell/tcp: unknown service

=======Path which works========

#/opt/ssh/PA-RISC1.1/bin/ssh tay
Password:

#/opt/ssh/PA-RISC1.1/bin/sftp tay
Connecting to tay...
Usage: rlogin host [ -ex ] [ -l username ] [ -8 ]
Connection closed

#/opt/ssh/PA-RISC1.1/bin/scp /tmp/hi tay:/tmp/
Usage: rlogin host [ -ex ] [ -l username ] [ -8 ]
lost connection

#/opt/ssh/PA-RISC1.1/bin/ssh -V
OpenSSH_4.4p1-hpn12v11, OpenSSL 0.9.7l 28 Sep 2006
HP-UX Secure Shell-A.04.40.006, HP-UX Secure Shell version

swlist -l product openssl
# Initializing...
# Contacting target "cambodia"...
#
# Target: cambodia:/
#

openssl A.00.09.07i.012 Secure Network Communications Protocol
openssl 0.9.8d openssl


Can someone please reply to my below queries..
Can we resolve this without a ssh re-install?
if we need to, do we need to have a server downtime for installing ssh?
14 REPLIES 14
Patrick Wallek
Honored Contributor
Solution

Re: ssh sftp scp on the server does not work

The fact that you are getting rlogin usage information when using ssh is the biggest problem.

Someone may have made a link that points ssh to rlogin. My guess is they may have actually meant to point rlogin to ssh and got it backwards.

What does:

# ls -l /opt/ssh/PA-RISC2.0/bin/ssh
# ls -l /opt/ssh/PA-RISC2.0/bin/sftp
# ls -l /opt/ssh/PA-RISC2.0/bin/scp

show?

If any of those show as a link to rlogin or rcp, then that is your problem. To fix it you would need to remove the links and restore the actual executables, possibly via a reinstallation of SSH.
Venky...
Advisor

Re: ssh sftp scp on the server does not work

rlogin and rcp point rightly to the ssh and scp paths..
Does a ssh re-install involve downtime?

#ls -lrt /bin/rlogin /bin/rcp
lrwxr-xr-x 1 root sys 3 Mar 8 2005 /bin/rlogin -> ssh
lrwxr-xr-x 1 root sys 3 Mar 8 2005 /bin/rcp -> scp

#ls -lrt /bin/ssh /bin/scp
lrwxr-xr-x 1 root sys 16 Mar 8 2005 /bin/ssh -> /opt/ssh/bin/ssh
lrwxr-xr-x 1 root sys 16 Mar 8 2005 /bin/scp -> /opt/ssh/bin/scp

cambodia:/->ls -lrt /opt/ssh/bin/ssh /opt/ssh/bin/scp
lrwxr-xr-x 1 root sys 27 Mar 8 2005 /opt/ssh/bin/ssh -> /opt/ssh/PA-RISC2.0/bin/ssh
lrwxr-xr-x 1 root sys 27 Mar 8 2005 /opt/ssh/bin/scp -> /opt/ssh/PA-RISC2.0/bin/scp
Patrick Wallek
Honored Contributor

Re: ssh sftp scp on the server does not work

You didn't do the 'ls -l' commands that I requested. Please run those.

The 'ls -l' commands you ran look good. BUT the executables you are running from /opt/ssh/PA-RISC1.1/bin and /opt/SSH/PA-RISC2.0/bin are not shown in your output.

Reinstalling SSH does not require a reboot, but the SSH daemons may be unavailable for a few minutes.
Venky...
Advisor

Re: ssh sftp scp on the server does not work

here is the ls -l output on the paths

#ls -l /bin/rlogin /bin/rcp
lrwxr-xr-x 1 root sys 3 Mar 8 2005 /bin/rcp -> scp
lrwxr-xr-x 1 root sys 3 Mar 8 2005 /bin/rlogin -> ssh

#ls -l /bin/ssh /bin/scp
lrwxr-xr-x 1 root sys 16 Mar 8 2005 /bin/scp -> /opt/ssh/bin/scp
lrwxr-xr-x 1 root sys 16 Mar 8 2005 /bin/ssh -> /opt/ssh/bin/ssh

#ls -l /opt/ssh/bin/ssh /opt/ssh/bin/scp
lrwxr-xr-x 1 root sys 27 Mar 8 2005 /opt/ssh/bin/scp -> /opt/ssh/PA-RISC2.0/bin/scp
lrwxr-xr-x 1 root sys 27 Mar 8 2005 /opt/ssh/bin/ssh -> /opt/ssh/PA-RISC2.0/bin/ssh

#ls -l /opt/ssh/PA-RISC2.0/bin/scp /opt/ssh/PA-RISC2.0/bin/ssh
-r-sr-xr-x 1 root bin 49152 Jan 25 2007 /opt/ssh/PA-RISC2.0/bin/scp
-r-sr-xr-x 1 root bin 40960 Jan 25 2007 /opt/ssh/PA-RISC2.0/bin/ssh
Patrick Wallek
Honored Contributor

Re: ssh sftp scp on the server does not work

These file sizes are WRONG:


#ls -l /opt/ssh/PA-RISC2.0/bin/scp /opt/ssh/PA-RISC2.0/bin/ssh
-r-sr-xr-x 1 root bin 49152 Jan 25 2007 /opt/ssh/PA-RISC2.0/bin/scp
-r-sr-xr-x 1 root bin 40960 Jan 25 2007 /opt/ssh/PA-RISC2.0/bin/ssh

Someone has copied the rlogin and rcp files to ssh and scp.

Here are rlogin and rcp from one of my 11.11 servers:

# ll /usr/bin/rlogin
├в r├в sr├в xr├в x 1 root bin 40960 Jan 25 2007 /usr/bin/rlogin*
# ll /usr/bin/rcp
├в r├в sr├в xr├в x 1 root bin 49152 Jan 25 2007 /usr/bin/rcp*

You notice that match your ssh and scp exactly.

Here is the ssh files from the same 11.11 server:

[ root@hquwh01:/opt/ssh/PA├в RISC2.0/bin ]
# ll
total 11584
drwxr├в xr├в x 2 bin bin 8192 Nov 11 2008 ./
drwxr├в xr├в x 5 bin bin 96 Nov 11 2008 ../
├в rwxr├в xr├в x 1 bin bin 126976 Aug 21 2008 scp*
├в rwxr├в xr├в x 1 bin bin 172032 Aug 21 2008 sftp*
├в rwxr├в xr├в x 1 bin bin 1523712 Aug 21 2008 ssh*
├в rwxr├в xr├в x 1 bin bin 1077248 Aug 21 2008 ssh├в add*
├в rwxr├в xr├в x 1 bin bin 978944 Aug 21 2008 ssh├в agent*
├в rwxr├в xr├в x 1 bin bin 1114112 Aug 21 2008 ssh├в keygen*
├в rwxr├в xr├в x 1 bin bin 917504 Aug 21 2008 ssh├в keyscan*
[ root@hquwh01:/opt/ssh/PA├в RISC2.0/bin ]

[ root@hquwh01:/opt/ssh/PA├в RISC1.1/bin ]
# ll
total 11648
drwxr├в xr├в x 2 bin bin 8192 Nov 11 2008 ./
drwxr├в xr├в x 5 bin bin 96 Nov 11 2008 ../
├в rwxr├в xr├в x 1 bin bin 126976 Aug 21 2008 scp*
├в rwxr├в xr├в x 1 bin bin 176128 Aug 21 2008 sftp*
├в rwxr├в xr├в x 1 bin bin 1531904 Aug 21 2008 ssh*
├в rwxr├в xr├в x 1 bin bin 1081344 Aug 21 2008 ssh├в add*
├в rwxr├в xr├в x 1 bin bin 983040 Aug 21 2008 ssh├в agent*
├в rwxr├в xr├в x 1 bin bin 1118208 Aug 21 2008 ssh├в keygen*
├в rwxr├в xr├в x 1 bin bin 921600 Aug 21 2008 ssh├в keyscan*

In a nutshell, your SSH installation is hosed. I would uninstall and start over.
Venky...
Advisor

Re: ssh sftp scp on the server does not work

Hey Patrick,

Gr8 news.. it is working now.

After I copied all the files in /opt/ssh/PA-RISC2.0/bin/ from an other server of similar version and hardware model.
In the previous ls -l command we can see that the scp and ssh have been modified on some other time than that of the installation time. So, have just copied them from similar other server and it worked...

Thanks a million for you help
TTr
Honored Contributor

Re: ssh sftp scp on the server does not work

> #ls -lrt /bin/rlogin /bin/rcp
> lrwxr-xr-x 1 root sys 3 Mar 8 2005 /bin/rlogin -> ssh
> lrwxr-xr-x 1 root sys 3 Mar 8 2005 /bin/rcp -> scp

There is something wrong here as well. The rcp and rlogin binaries are linked to the SSH equivalents. Someone has really messed up some of the system binaries in this server.
Venky...
Advisor

Re: ssh sftp scp on the server does not work

Hi,

so wht do you think which needs to be done?
TTr
Honored Contributor

Re: ssh sftp scp on the server does not work

You need to put back the the original binaries for rcp and rlogin.

The rcp and rlogin binary files were in place of the ssh and scp files. If you still have them put them back in /bin/rlogin and /bin/rcp.