Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ssh : port 22 connection refused 1

Status
Not open for further replies.

llingf

Technical User
Oct 3, 2002
25
0
0
US
hi everyone:

I need someone help over the ssh connection issue,
I could ssh out to other computer from computer A but unabled to ssh back the computer A, I got a messages says
the port 22 connection fail.


thanks
 
check firewall settings

iptables -L



you might want to add this
Code:
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
 
ummm, is 'sshd' running on the problem destination?

what exactly is the problem? no session, failed login, what?

D.E.R. Management - IT Project Management Consulting
 
Sometimes the ssh debug mode can give you more information on what the problem might be ...

But use this with caution because if ssh is your only access to the system you might lock yourself out if something goes wrong ! So you should at least open up telnet access during that time and make sure you can logon via telnet ...

However in order to switch to the debug mode you'll have to stop the ssh subsystem (e.g. stopsrc -s sshd) and then start ssh like this:

/usr/local/bin/sshd -d -D
(or whatever path you are using)

This will give you a detailed output on your console. Then try to connect and see what happens. After that use <CTRL>+<C> to quit the sshd and restart your subsystem using startsrc -s sshd (or whatever it is called on your machine).

Regards
Thomas
 
Oops :)

My mistake ...
You don't have subsystems under Linux ...

So just stop the ssh process and start it again with the
-d -D
options.

...
 
Thanks for the responding, I just came back from vacation and I'm very glade to see the help I got from you guys.

I disabled the Iptables and run the /usr/local/sshd -D -d
got messages below

debug1 sshd version Openssh.3.1p1
debug1 read PEM private key done: type RSA
debug1 pivate host key: #0 type 1 RSA
debug1 read PEM private key done: type DSA
degug1 private host key: #1 type 2 DSA
sockey: Address family not responding by protocal
debug1 Bind to port 22 on 0.0.0.0
server listening on 0.0.0.0 port 22

and my computer was hanging after above messages.
Its running Linux 7.3.

Anyone have idea about this messages.
Thanks
 
Hi llingf,

It's not hanging at all. It's running!
When you run ssh with the -D option it doesn't become a resident program. (e.g. Daemon)

TSch stated that option, so that you can view what the program is doing in a seperate session.

Just do a "/etc/init.d/sshd start"
Make sure you have another user besides root on your system
to log on with.

Make sure no rules are blocking communications like sillyVM said. With "/sbin/iptables -L" you can check whether you accept all communication (BAD Idea) or whether you are blocking ssh connections (inbound port 22 tcp)

Hope this helps you,

Ted Kraan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top