Operating System - HP-UX
1753846 Members
7673 Online
108807 Solutions
New Discussion юеВ

New to ssh & putty - connection refused

 
SOLVED
Go to solution
Tim O'Connell
Regular Advisor

New to ssh & putty - connection refused

Hi,

I have just downloaded & installed ssh on my HPUX 11.11. server. Install worked perfectly. I have downloaded putty.exe to my pc. I now try co connect to the HPUX server using Putty/SSH & I get "Server unexpectedly closed network connection". When I look at syslog.log I see "Refused connection from xx.xx.xxx.xx "(My pc'IP address). I have added a line to /etc/services - ssh 22/ssh # Secure Shell Protocol - but this didn't help. If I use putty to connect using telnet it connects fine. I have looked at the forum but haven't been able to find a solution. Hope someone can help as I'm out of my depth here.

Thanks,

Tim
8 REPLIES 8
Anshumali
Esteemed Contributor

Re: New to ssh & putty - connection refused

Should be running after the new install, you should be sure that there is no FW blocking.
Try with /sbin/init.d/secsh stop; /sbin/init.d/secsh start

Anshu
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Matti_Kurkela
Honored Contributor
Solution

Re: New to ssh & putty - connection refused

The SSH daemon does not care whether port 22 is declared as ssh in /etc/services or not. Adding ssh to /etc/services just helps tools like netstat to identify the SSH connections.

If I recall correctly, SSH as packaged by HP will support libwrap: if you have /etc/hosts.deny and/or /etc/hosts.allow configured, sshd will obey them even though tcpwrapper is not explicitly invoked at any point.

The syslog line "Refused connection from..." indicates that the incoming connection reached the application layer of the HP-UX server, so it's unlikely to be a firewall issue.

MK
MK
Anshumali
Esteemed Contributor

Re: New to ssh & putty - connection refused

Agreed Matti.... conenction refused messaged at syslog.log means no firewall blockage in between.....

Thanks,
Anshu
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Steven Schweda
Honored Contributor

Re: New to ssh & putty - connection refused

Note that "Refused connection from [...]" in
the server's log is different from a
"connection refused" complaint on the client
side.

Usually, the first step in tracing a problem
like this it to use a verbose "ssh" command
on the client. Something like:
ssh -v [...]

I have no idea how to do this with PuTTY, but
if it has a "-v" option, I'd try that.
Geoff Wild
Honored Contributor

Re: New to ssh & putty - connection refused

in /etc/rc.config.d/sshd
set
SSHD_START=1

then

/sbin/init.d/secsh start

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Tim O'Connell
Regular Advisor

Re: New to ssh & putty - connection refused

Matti,

You hit the nail on the head. I have a hosts.allow & a hosts.deny. The hosts.deny says ALL:ALL. I renamed that & putty worked but a little slow. Is it OK to not have a hosts.deny?.

Thanks for all the replies.

Tim
Tim O'Connell
Regular Advisor

Re: New to ssh & putty - connection refused

Thanks, Matti & all who replied
Matti_Kurkela
Honored Contributor

Re: New to ssh & putty - connection refused

As your hosts.deny had ALL:ALL in it, your site obviously follows the recommended "allow only what you need and deny everything else" policy.

Instead of removing ALL:ALL from hosts.deny, I'd recommend putting "sshd:ALL" or maybe something more limited to hosts.allow.

As with standard tcpwrapper rules, hosts.allow takes precedence over hosts.deny.

MK
MK