Fedora Linux Support Community & Resources Center
  #1  
Old 1st March 2011, 03:53 PM
zbormanchino Offline
Registered User
 
Join Date: Nov 2010
Location: Chicago
Posts: 41
linuxfedorafirefox
Question Port 22: Connection refused!?

Hey all,

Friday night I was working on some networking stuff between my two Fedora 14 boxes. I have my laptop and my desktop. on both machines I have "system-config-firewall 1.2.27" and "iptables" (i believe both come standard on F14?) I kept getting the same message as seen below before realizing perhaps I should check my firewall!

I added a rule for incoming and outgoing traffic on port 22 and was able to get in with no problems at all!
however today I can't ssh into anything... I can't use "Remote Desktop Viewer 2.31.4" to vnc into the machine anymore. I can't remember the exact error message at this time, it's something close to "Connection was terminated" or "Unable to connect" I can update this message later.

last night I foolishly uninstalled the system-config-firewall and then uninstalled iptables to see if it was a simple firewall issue.... totally hosed my system <insert smiley!>

After reinstalling and realizing I didn't backup my documents <insert smiley!...again...> I started reinstalling all of my applications. I'm still unable to use ssh and I've tried to ssh my own computer.

Is this possible?

# ssh 127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
__________________
[SIGPIC][/SIGPIC]
Reply With Quote
  #2  
Old 1st March 2011, 04:19 PM
glennzo Offline
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Age: 57
Posts: 14,866
windows_xp_2003firefox
Re: Port 22: Connection refused!?

Is ssh running?
PHP Code:
service ssh status 
__________________
Glenn
The Bassinator © ®

[SIGPIC][/SIGPIC]
Laptop: Just a couple of old single core units
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / Kingston HyperX 3K SSD 240GB SATA 3.0 / 1TB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #3  
Old 1st March 2011, 04:33 PM
zbormanchino Offline
Registered User
 
Join Date: Nov 2010
Location: Chicago
Posts: 41
linuxfedorafirefox
Re: Port 22: Connection refused!?

[root@fedora micah]# service ssh status
ssh: unrecognized service


interesting... let me search yum for ssh
__________________
[SIGPIC][/SIGPIC]
Reply With Quote
  #4  
Old 1st March 2011, 04:38 PM
kurtdriver Offline
Registered User
 
Join Date: Jul 2005
Location: Vancouver, Canada
Posts: 1,628
linuxfedorafirefox
Re: Port 22: Connection refused!?

Type this to start it.
Code:
service sshd start
Reply With Quote
  #5  
Old 1st March 2011, 04:50 PM
zbormanchino Offline
Registered User
 
Join Date: Nov 2010
Location: Chicago
Posts: 41
linuxfedorafirefox
Re: Port 22: Connection refused!?

[root@fedora micah]# yum install openssh.x86_64
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Setting up Install Process
Package openssh-5.5p1-24.fc14.2.x86_64 already installed and latest version
Nothing to do
[root@fedora micah]# yum install openssh-clients.x86_64
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Setting up Install Process
Package openssh-clients-5.5p1-24.fc14.2.x86_64 already installed and latest version
Nothing to do



Interesting as well... Thoughts?

---------- Post added at 09:44 AM ---------- Previous post was at 09:42 AM ----------

[root@fedora micah]# service sshd status
openssh-daemon is stopped
[root@fedora micah]# service sshd start
Generating SSH2 RSA host key: [ OK ]
Generating SSH1 RSA host key: [ OK ]
Generating SSH2 DSA host key: [ OK ]
Starting sshd: [ OK ]

You sir are a genius!! What do I need to do in order have sshd start when the computer does?

---------- Post added at 09:50 AM ---------- Previous post was at 09:44 AM ----------

Disregard the last question. I'm going to mark this post as solved and go research my second question! Thanks again Kurt
__________________
[SIGPIC][/SIGPIC]
Reply With Quote
  #6  
Old 1st March 2011, 05:35 PM
glennzo Offline
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Age: 57
Posts: 14,866
windows_xp_2003firefox
Re: Port 22: Connection refused!?

Crap! My bad! Should have been service sshd status.

PHP Code:
[glenn@server ~>$ service sshd status
openssh
-daemon (pid  1493is running... 
Set the daemon to on and then start it.
PHP Code:
chkconfig sshd on
service sshd start 
It will then start automatically at every boot.
__________________
Glenn
The Bassinator © ®

[SIGPIC][/SIGPIC]
Laptop: Just a couple of old single core units
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / Kingston HyperX 3K SSD 240GB SATA 3.0 / 1TB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #7  
Old 1st March 2011, 05:50 PM
zbormanchino Offline
Registered User
 
Join Date: Nov 2010
Location: Chicago
Posts: 41
linuxfedorafirefox
Re: Port 22: Connection refused!?

service sshd status
openssh-daemon (pid 1503) is running...


perfect thank you!
__________________
[SIGPIC][/SIGPIC]
Reply With Quote
  #8  
Old 15th February 2012, 06:31 PM
andres29 Offline
Registered User
 
Join Date: Feb 2012
Location: philippines
Posts: 3
linuxfirefox
Re: Port 22: Connection refused!?

to the administrators, please help me about the port 22 refused/timeout for wan connection, but for lan it is working... i already closed my firewall, but still having port 22 refused/timeout problem.. is it possible that the problem is come from the internet service provider?

please help me.. thanks and god bless
Reply With Quote
  #9  
Old 19th January 2013, 09:12 AM
mehdi601f Offline
Registered User
 
Join Date: Jan 2013
Location: tnk
Posts: 1
windows_8chrome
Lightbulb Re: Port 22: Connection refused!?

rm -rf /root/.ssh/*

service sshd stop
service sshd start
Reply With Quote
  #10  
Old 19th January 2013, 09:23 AM
flyingfsck Online
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,946
linuxopera
Re: Port 22: Connection refused!?

First of all, you don't really need a firewall on a Linux machine, so you can safely disable it till you got things under control.

You say it works on the LAN. Therefore SSH is OK. You just have a firewall problem so turn it off to prove the point.
Reply With Quote
  #11  
Old 6th February 2013, 11:04 PM
zogthegreat Offline
Registered User
 
Join Date: Feb 2005
Location: Montreal
Posts: 37
windows_7firefox
Re: Port 22: Connection refused!?

hi mehdi601f,

To open port 22, open a terminal, switch to root and run the following command:

iptables -A INPUT -p tcp -m tcp --syn --dport 22 -j ACCEPT

Hit enter end exit your shell

Two good sources for configuring and managing iptables are:

http://wiki.centos.org/HowTos/Network/IPTables

http://www.linuxhomenetworking.com/w...s#.URLOImeym2g

Although I am sure that there is some sort of GUI to manage iptables, it really will help you in the long term if you learn how to manage and monitor your firewall from the command line.

Good luck

zog

---------- Post added at 05:04 PM ---------- Previous post was at 04:46 PM ----------

btw:

I forgot to mention, if you want to keep this port open for future use, do the following to make the changes permanent:

iptables-save > /etc/sysconfig/iptables

systemctl restart iptables.service

Just remember, always start your security at "Paranoid" and RAISE your security as needed. I am not trying to be funny. Leaving ports open that do not need to be open is a bad security practice to get into.

Last edited by zogthegreat; 6th February 2013 at 10:48 PM.
Reply With Quote
  #12  
Old 29th May 2013, 08:35 AM
itskahn Offline
Registered User
 
Join Date: May 2013
Location: India
Posts: 1
linuxfirefox
Re: Port 22: Connection refused!?

I use fedora 16. From my machine if I connect to any machine within network, it can be connected easily. After connecting the machine if I type finger, it shows my machine also, but if I want to connect my machine from that machine via ssh username@IP it shows the following error 'ssh: connect to host 172.16.22.151 port 22: Connection refused'. This problem has arose suddenly. Few days back also I can connect to my machine from any machine. But I cannot connect now. Please help me.

service sshd status shows:
Redirecting to /bin/systemctl status sshd.service
sshd.service - OpenSSH server daemon
Loaded: loaded (/lib/systemd/system/sshd.service; enabled)
Active: failed since Wed, 29 May 2013 12:58:02 +0530; 26s ago
Process: 2830 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=255)
CGroup: name=systemd:/system/sshd.service


system-config-services part
sshd is failed it shows:
This unit has failed: failed
It is not running or started or any thing else.

system-config-firewall is enabled and there ssh is ssh is checked and port/protocol status is 22/tcp

Please help me to solve the problem
Reply With Quote
Reply

Tags
ssh f14

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH error: port 22 connection refused snehal.lamture Linux Chat 1 22nd April 2009 07:44 AM
SSH connection refused infernosoft Servers & Networking 5 9th April 2009 12:32 PM
Connection refused until in network connection JJS Servers & Networking 5 2nd November 2004 08:27 PM


Current GMT-time: 06:12 (Sunday, 21-12-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
...Mykonos, Greece Travel Photos - Tacurong City, Province Of Sultan Kudarat - Tapovan Rishikesh Instagram Photos