LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-25-2005, 01:30 AM   #1
bingo11
LQ Newbie
 
Registered: Jun 2005
Posts: 3

Rep: Reputation: 0
SSH wont connet


Hey all, I am having a hard time figuring out why i cannot connect to my box from outside through SSH when logging through local host works perfectly.

When i check my iptables through iptables -L i have nothing at all however when i nmap my port 22 i get :

22/tcp filtered ssh

This apparently means that this port is under some kind of firewall control...

Any help about what i should do to be able to connect from outside would be greatly appreciated.

Madi

PS: Even after temporarily disabling iptables "chkconfig iptables off" i cannot connect and nmap still give the same output

Last edited by bingo11; 06-25-2005 at 02:05 AM.
 
Old 06-25-2005, 11:03 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 245Reputation: 245Reputation: 245
Is this host behind some kind of router/firewall? If so, do you have port forwarding for port 22 to the correct host your trying to connect to?
 
Old 06-25-2005, 04:47 PM   #3
bingo11
LQ Newbie
 
Registered: Jun 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by trickykid
Is this host behind some kind of router/firewall? If so, do you have port forwarding for port 22 to the correct host your trying to connect to?
Thnaks trickykid for your interest,
No unfortunately i am not behind any firewall or router. That's what is making me go crazy...
Any other suggestions ??

Thx,

Madi
 
Old 06-25-2005, 07:09 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Using chkconfig is only going keep services from starting after a reboot, so try using 'service iptables stop' or '/etc/init.d/iptables stop' instead

Also check that SSHd is running on the server

Finally try running tcpdump to make sure that the sshd server is seeing the packets (tcpdump port 22).
 
Old 06-26-2005, 02:05 AM   #5
bingo11
LQ Newbie
 
Registered: Jun 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Capt_Caveman, Thx for the suggestions.
I have indeed stopped the iptables and made sure that they wont restart after i rebooted. On the other hand, i assume sshd is running on my machine since i can connect from local host.
As for TCPDUMP, i am no expert in networking but i see a couple of messages coming fom the machine i tried to connect (xxx.xxx.xxx.xxx.ssh) from to my box and couple ou ack sent back.
when i stop the tcpdump i get the following message,

36 packets captured
36 packets received by filter
0 packets dropped by kernel

If i understand correctly, i am getting the ssh requests but they are still getting stopped by a firewall service ...is that correct ?

Madi

Last edited by bingo11; 06-26-2005 at 06:36 PM.
 
Old 06-26-2005, 07:04 PM   #6
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
On the other hand, i assume sshd is running on my machine since i can connect from local host.
Sounds like it's running then, however make sure that it's listening on the correct IP address. Run 'netstat -pant" and you should see an entry for port 22. Make sure that the ip address for that entry is not 127.0.0.1. It will likely be 0.0.0.0 or :::: or whatever the machines IP should be.

As for TCPDUMP, i am no expert in networking but i see a couple of messages coming fom the machine i tried to connect (xxx.xxx.xxx.xxx.ssh) from to my box and couple ou ack sent back.
Could you post part of the output (make sure to change any public IPs).

If i understand correctly, i am getting the ssh requests but they are still getting stopped by a firewall service ...is that correct ?
Usually yes, however there are a number of things such as networking problems that can result in a 'filtered' nmap status. Also some ISPs filter certain ports at upstream routers, so you may want to try using traceroute and see if your packets are dying somewhere upstream (try comparing normal traceroute to traceroute on port 22). It could also be a problem with the firewall of the remote machine you are sshing from.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh wont connect outside of local network clintonkerr Linux - Software 9 09-20-2005 08:35 AM
Can't boot into solaris and can't connet to internet aeruzcar Solaris / OpenSolaris 11 01-25-2005 04:27 PM
cannot connet co x-server when type start kde Mac Write Debian 2 08-16-2004 08:31 PM
kopete does not connet to AIM server lazychris2000 Linux - Software 2 09-21-2003 07:11 AM
when I login not as root, it does not connet to internet........ help broodman Linux - Networking 9 07-27-2003 12:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration