Operating System - HP-UX
1833756 Members
2839 Online
110063 Solutions
New Discussion

Re: ssh connection problem

 
Barbara Flynn_1
Frequent Advisor

ssh connection problem

Hi

I have installed ssh on a HPUX11.00 server. I've generated the necessary keys etc but everytime I try to ssh to the server I get the following error:

Received disconnect from 172.24.10.19: 2: dup #1 failed: Bad file number

I've run the sshd with the extra debug options but it just generates so much info.

Anyone got any ideas on the "bad file number"??

Thanks Barbara
13 REPLIES 13
John Poff
Honored Contributor

Re: ssh connection problem

Hi Barbara,

What version of ssh did you install on your HP-UX server? What version of ssh are you trying to connect to it with, and from what type of machine (HP-UX, Linux, Windows, etc.)?

JP
Barbara Flynn_1
Frequent Advisor

Re: ssh connection problem

Hi JP

I installed the latest version from HP, T1471AA -> A.03.81.002 HP-UX Secure Shell

I am actually just trying to ssh between a couple of HPUX machines and it works fine on all of my other servers.

It doesn't even work if I try locally on the server!

Cheers Barbara
RAC_1
Honored Contributor

Re: ssh connection problem

Aha, it is not working on local machine.. Did you add public key to authorized_keys file??

Anil
There is no substitute to HARDWORK
Barbara Flynn_1
Frequent Advisor

Re: ssh connection problem

I did!
John Poff
Honored Contributor

Re: ssh connection problem

So it isn't working on just one machine? It kind of sounds like an installation or a configuration problem. You mentioned that it doesn't even work locally. Does that mean that you get the same 'bad file number' error if you try to ssh to that machine from itself?

I poked around on the web a bit and that 'bad file number' with ssh seems to be an old error. Is it possible that you are starting up an old version of the 'ssh' executeable on that box and not the one from HP? What do you get when you do 'whence ssh'?

I'm running the same version as you, and here is what I have for my 'ssh' executable:

# whence ssh
/usr/bin/ssh

# ls -ld /usr/bin/ssh
lrwxr-xr-x 1 root sys 16 Oct 25 16:32 /usr/bin/ssh -> /opt/ssh/bin/ssh

# ls -ld /opt/ssh/bin/ssh
lrwxr-xr-x 1 root sys 27 Oct 25 16:32 /opt/ssh/bin/ssh -> /opt/ssh/PA-RISC2.0/bin/ssh
# ls -ld /opt/ssh/PA-RISC2.0/bin/ssh
-rwxr-xr-x 1 bin bin 1523712 Jul 2 10:53 /opt/ssh/PA-RISC2.0/bin/ssh

JP

F Verschuren
Esteemed Contributor

Re: ssh connection problem

The fasted is just reinstall it,

if you want to fix it please post the outupt of ssh -v

more info can be fount in:

http://www.wellho.net/forum/The-Tcl-programming-language/quot-open-slave-pty-bad-file-number-quot-error.html

http://www.emsei.psu.edu/ecf/alt/general/ssh.html
Barbara Flynn_1
Frequent Advisor

Re: ssh connection problem

Hi JP

If I do "ssh sapprod" I get the bad file number both locally and from other servers.

However I can ssh out from "sapprod" to other servers......

Below is the output from your suggestion......

sapprod:opt/ssh/PA-RISC2.0/bin->ls -ld ssh
-rwxr-xr-x 1 bin bin 1679360 Jul 3 07:35 ssh

I literally reinstalled the software yesterday.....
Barbara Flynn_1
Frequent Advisor

Re: ssh connection problem

Hi Freek

Unfortunately the reinstall solution doesn't work, I already tried that!!!
Tor-Arne Nostdal
Trusted Contributor

Re: ssh connection problem

So you try to "loopback" to the same host.

I tried this on one of our machines and it was successful.

myhost[root]: swlist -l product | grep -i secure
Secure_Shell A.03.71.000 HP-UX Secure Shell

myhost[root]: ssh myhost
The authenticity of host 'myhost (123.123.123.23)' can't be established.
RSA key fingerprint is 00:0d:8c:aa:bb:cc:dd:ee:ff:01:02:03:04:01:c2:10.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'myhost,123.123.123.23' (RSA) to the list of known hosts.
Password:
Last login: Wed Dec 1 14:54:46 2004 from otherhost

Hint:
I also have myhost in myhost:/.rhosts file
Could this make a difference for you ?

/Tor-Arne
I'm trying to become President of the state I'm in...
Tor-Arne Nostdal
Trusted Contributor

Re: ssh connection problem

Perhaps there is no Daemon servicing SSH...

When you connect to other machine you start the ssh program and connect.
The sshd is listening for incoming ssh connects.

Do you have an sshd running ?
myhost[root]# ps -ef | grep sshd
root 937 1 0 Oct 17 ? 0:00 /opt/ssh/sbin/sshd

If not try start with:
myhost[root]# /sbin/init.d/secsh start

If it doesn't start check:
myhost[root]# cat /etc/rc.config.d/sshd
# SSHD_START: Set to 1 to start SSH daemon
# SSHD_ARGS: Command line arguments to pass to sshd
#
SSHD_START=1
SSHD_ARGS=

/Tor-Arne
I'm trying to become President of the state I'm in...
Barbara Flynn_1
Frequent Advisor

Re: ssh connection problem

Thanks for the suggestion Tor-Arne but the daemon is up and running!
RAC_1
Honored Contributor

Re: ssh connection problem

when you added the public key to authorized_keys file, did you do cut and paste?? If yes, do not do that. Do a cat on public keys and appened the contents to authorized_keys file.

Anil
There is no substitute to HARDWORK
Barbara Flynn_1
Frequent Advisor

Re: ssh connection problem

Logged a case with HP.