View previous topic :: View next topic |
Author |
Message |
Lousie_Louie n00b

Joined: 06 Jun 2005 Posts: 13
|
Posted: Wed Jun 08, 2005 2:59 am Post subject: SSH 'Connection Refused' [solved] |
|
|
Every time I try to ssh into my box (inside and outside my local network) i get a 'connection refused' error.
The obvious thing would to be sure that my firewall is allowing the right ports, but I found out I did not have iptables, and I need to emerge that, So I did.
The I found out that I need to change something in my kernal to get iptables working. All I really want to do is turn my firewall off, but I'm not sure if I have one. I didn't know networking would work without iptables.
Do I need to recompile my kernal to get this working? or is there a simpler way?
(I am look at directions here: http://gentoo-wiki.com/HOWTO_Iptables_for_newbies )
Last edited by Lousie_Louie on Thu Jun 09, 2005 2:54 am; edited 1 time in total |
|
Back to top |
|
 |
raf Apprentice


Joined: 16 Jan 2005 Posts: 158
|
Posted: Wed Jun 08, 2005 3:21 am Post subject: |
|
|
If you want your firewall off then why did you emerge iptables? Just get rid of it! This way you will not have a firewall.
I know this sounds simple, but is your sshd service running? I've had that happen to me a couple of times where it would just say connection refused and it turned out my sshd service was down. Try:
Code: | /etc/init.d/sshd restart |
|
|
Back to top |
|
 |
gnuageux Veteran


Joined: 17 Apr 2004 Posts: 1201
|
Posted: Wed Jun 08, 2005 5:46 am Post subject: |
|
|
/etc/init./sshd status will also tell you if its running. _________________ The realOTW: http://forums.realotw.org/index.php
Registered Linux user#364538 |
|
Back to top |
|
 |
rex123 Apprentice

Joined: 21 Apr 2004 Posts: 272
|
Posted: Wed Jun 08, 2005 9:20 am Post subject: Re: SSH 'Connection Refused' |
|
|
Lousie_Louie wrote: | Every time I try to ssh into my box (inside and outside my local network) i get a 'connection refused' error.
The obvious thing would to be sure that my firewall is allowing the right ports, but I found out I did not have iptables, and I need to emerge that, So I did.
[...] |
What you did was to install a firewall in order to turn it off. This is probably a useful exercise, because iptables is a fun application, but it's not going to help you fix your sshd problem. You then suggest modifying your kernel. Again, this is fun if you have time on your hands, but it is extremely unlikely to fix your sshd problem.
Some other things to try (apart from /etc/init.d/sshd status):
ssh localhost (from the machine itself). This will bypass all networking (and firewalls), so you will see if sshd is responding.
netstat -lntp (as root). This shows you what is listening on what port. Look for something listening on port 22. If it's not there, it isn't running. |
|
Back to top |
|
 |
Lousie_Louie n00b

Joined: 06 Jun 2005 Posts: 13
|
Posted: Wed Jun 08, 2005 12:50 pm Post subject: |
|
|
Ok it doesn't look like it is running.
Code: |
root@axiom axiom # sshd
sshd re-exec requires execution with an absolute path
root@axiom axiom # find / -name sshd
/etc/pam.d/sshd
/etc/init.d/sshd
root@axiom axiom # /etc/init.d/sshd restart
root@axiom axiom # ssh localhost
ssh: connect to host localhost port 22: Connection refused
root@axiom axiom #
|
Hope one of you helpful people can make sense of this. |
|
Back to top |
|
 |
gnuageux Veteran


Joined: 17 Apr 2004 Posts: 1201
|
Posted: Wed Jun 08, 2005 8:42 pm Post subject: |
|
|
I think that by default ssh is set to refuse localhost connections
$nmap localhost
See if its an open port, Ill be it is. Im sure somone around here knows how to allow ssh connections from localhost, but I dont off the top of my head and im @ work  _________________ The realOTW: http://forums.realotw.org/index.php
Registered Linux user#364538 |
|
Back to top |
|
 |
Lousie_Louie n00b

Joined: 06 Jun 2005 Posts: 13
|
Posted: Thu Jun 09, 2005 1:23 am Post subject: |
|
|
I have no ports open. Got the same result from another box on my local network. It would appear that I have a nice firewall up, but I havn't got on installed, nor do I have the iptables module on my kernal.
Code: |
root@axiom axiom # nmap localhost
Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2005-06-08 21:03 EDT
All 1663 scanned ports on localhost (127.0.0.1) are: closed
Nmap finished: 1 IP address (1 host up) scanned in 0.292 seconds
root@axiom axiom # |
I thought I understood these things when I was on debian, but now I am confused.
<clarify> All I want to do is to be able to ssh into my box. </clarify> |
|
Back to top |
|
 |
gnuageux Veteran


Joined: 17 Apr 2004 Posts: 1201
|
Posted: Thu Jun 09, 2005 2:20 am Post subject: |
|
|
Huh, whats /etc/init.d/sshd status return? _________________ The realOTW: http://forums.realotw.org/index.php
Registered Linux user#364538 |
|
Back to top |
|
 |
Lousie_Louie n00b

Joined: 06 Jun 2005 Posts: 13
|
Posted: Thu Jun 09, 2005 2:41 am Post subject: |
|
|
nothing. You'd think it'd throw some sort of error if it failed.
Code: |
root@axiom axiom # /etc/init.d/sshd
root@axiom axiom # /etc/init.d/sshd status
root@axiom axiom #
|
it does throw an error if I don't give the full path
Code: |
root@axiom axiom # sshd
sshd re-exec requires execution with an absolute path
root@axiom axiom #
|
somthing is there... |
|
Back to top |
|
 |
Lousie_Louie n00b

Joined: 06 Jun 2005 Posts: 13
|
|
Back to top |
|
 |
|