Operating System - HP-UX
1748268 Members
3697 Online
108760 Solutions
New Discussion юеВ

Re: Getting "Connection Refused" message when using sftp

 
SOLVED
Go to solution
Paul Maglinger
Regular Advisor

Getting "Connection Refused" message when using sftp

Running 11.23. Trying to connect to remote server using sftp. when I try, I get the following:

#sftp sftp.domainname.com
Connecting to sftp.domainname.com...
ssh: connect to host sftp.domainname.com port 22: Connection refused
Connection closed

I can perform the same command from my Windows workstation and at least get a login prompt. I don't have HIPS or firewall configured on this server. sshd is running. Thoughts anyone?
35 REPLIES 35
Steven Schweda
Honored Contributor

Re: Getting "Connection Refused" message when using sftp

"Connection refused" normally means that you
can talk to the other system, but that it
isn't running (or willing to run) the
requested server. This normally rules out
basic network/routing problems.

> Thoughts anyone?

Many things are possible. Some clever
firewall could do it.

> I don't have HIPS or firewall configured on
> this server.

Which server is "this server"? What's
_between_ the systems?

> sshd is running.

So you claim. (I see no evidence.) On what?

You're hiding the actual commands, so it's
hard to know what you really did, but
"sftp.domainname.com" might mean different
things on the two systems. Specifying an IP
address might change the results.
OldSchool
Honored Contributor

Re: Getting "Connection Refused" message when using sftp

any chance you're using non-std ports, ie. other than 22?
Tingli
Esteemed Contributor

Re: Getting "Connection Refused" message when using sftp

Take a look at /var/adm/log/syslog.log, there might be some info there.
Paul Maglinger
Regular Advisor

Re: Getting "Connection Refused" message when using sftp

No HIPS or firewall on mine (the client server). The sftp server is a remote vendor. We have a firewall appliance on our side, but as I can at least get to a login prompt from my Windows workstation, which is on the same domain as the client server, and I can hit it from a SCO box, so I don't believe the appliance is the problem.

It seems to me to be localized to this HP-UX box. I'm just trying to figure out if I missed something obvious.

And yes,

ps -ef | grep sshd
root 1502 1 0 Apr 18 ? 00:00 /opt/ssh/sbin/sshd

Using the ip address made no difference.
Paul Maglinger
Regular Advisor

Re: Getting "Connection Refused" message when using sftp

Using port 22. Even tried telneting to that port.

syslog didn't show anything out of the ordinary.

Steven Schweda
Honored Contributor

Re: Getting "Connection Refused" message when using sftp

> [...] I can hit it [...]

This means? (My psychic powers are weak.)

> Using the ip address made no difference.

And you tried using "the ip address" on the
Windows system, too? Showing actual commands
with their actual output (that is, actual
evidence) can be _so_ much clearer than vague
descriptions and interpretations.

> ps -ef | grep sshd
> root 1502 1 0 Apr 18 ? 00:00 /opt/ssh/sbin/sshd

If that's on your local SFTP client system,
then who cares? You're trying to talk to the
sshd on the remote server system. Aren't
you? _That's_ where sshd (or something like
it) needs to be running.

For a good time, you might try (everywhere)
a command like:

telnet 22

where is the name or IP address
of the SFTP server. This would tend to
eliminate some potential client-side SSH
configuration quirks.
OldSchool
Honored Contributor

Re: Getting "Connection Refused" message when using sftp

"Using port 22. Even tried telneting to that port."

right...that was here:

"ssh: connect to host sftp.domainname.com port 22: Connection refused"


But, what I meant is: is this different from the boxes which work?
Steven Schweda
Honored Contributor

Re: Getting "Connection Refused" message when using sftp

> Using port 22. Even tried telneting to that
> port.

You can probably see exactly what you're
doing (and where), and what happens when you
do it, but we non-psychics often can't.
Please try to keep this in mind.
G V R Shankar
Valued Contributor

Re: Getting "Connection Refused" message when using sftp

hi,

You say that atleast u got login prompt. are u able to login
is the session diconnecting.

Please check the time stamp of /var/adm/net*

if it is latest, please give the o/p of the following
netfmt -t -f /var/adm/

Cheers,
Ravi.