HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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.
Venky...
Advisor

Re: ssh sftp scp on the server does not work

I think that has been done intentionally so that no one use the rlogin or rcp.
Matti_Kurkela
Honored Contributor

Re: ssh sftp scp on the server does not work

My guess is this:

First, someone has replaced rlogin and rcp with links to ssh/scp. As you said, the intention has probably been to make the users (and any existing scripts) use SSH. So far, no problem.

After that, the system has been patched, and the patch has included new versions of rlogin and rcp. When installing the patch, the swinstall/swagent has simply tried to overwrite the old files. But because they had been replaced with links, the patch installation procedure has followed the links and overwritten your ssh and scp binaries instead.

Lesson learned: when modifying standard system binaries, always think about what will happen when new patches are installed.

MK
MK
Venky...
Advisor

Re: ssh sftp scp on the server does not work

Hi MK,

Brilliant was your analysis..
yes.. lesson learnt, will note down for the future.


Thanks a lot
Regards,
Venky
Venky...
Advisor

Re: ssh sftp scp on the server does not work

I am closing off the thread..
had great time working with all you guys..

Thanks once again to each and everyone.
Venky...
Advisor

Re: ssh sftp scp on the server does not work

need to check for the binaries which have been linked to other files when installing a patch.