LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2016, 10:28 AM   #1
IT1
LQ Newbie
 
Registered: May 2016
Posts: 9

Rep: Reputation: Disabled
SSH Connection refused


Hi, I am having an issue with connection to ssh via terminal. It gives the error port 22 connection refused?
 
Old 05-20-2016, 10:44 AM   #2
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
Blog Entries: 3

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Quote:
Originally Posted by IT1 View Post
Hi, I am having an issue with connection to ssh via terminal. It gives the error port 22 connection refused?
Hi!

We need more information.
- Could you provide the command you are issuing?
- Have you checked that port 22 is indeed open?
- Have you tried nmap on the server you are trying to connect to?

Best regards,
HMW
 
Old 05-20-2016, 11:12 AM   #3
IT1
LQ Newbie
 
Registered: May 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
Hi, Thanks for reply. yes port 22 is open have confirmed. Actually the VPN connection to a site is giving error code is 0. I actually require the VPN tunnel to be working first and after that I should be able to connect to any router but the VPN tunnel is giving that error message 'please check your input.

The vpn client stopped, error code is 0'

Command for SSH is 'ssh -l xxxxx@0.0.0.0' example
 
Old 05-20-2016, 11:19 AM   #4
pingu_penguin
Member
 
Registered: Aug 2004
Location: pune
Distribution: Slackware
Posts: 349

Rep: Reputation: 60
The error is connection "refused" , it means the connection was actively refused by the ssh server.

If the port wasnt open you would probably had a connection timeout.

refused can mean :

-> invalid username password combination
-> password / username expired
-> your IP / account has been banned/blocked.
 
1 members found this post helpful.
Old 05-20-2016, 12:17 PM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,294
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
Quote:
Originally Posted by IT1 View Post
Command for SSH is 'ssh -l xxxxx@0.0.0.0' example
It maybe the way you have -l that is throwing things off. The right syntax would be either
Code:
ssh -l xxxxx 0.0.0.0
or

Code:
ssh xxxxx@0.0.0.0
Where xxxxx is a valid user name and 0.0.0.0 is substituted for a valid host name or ip address.
 
Old 05-20-2016, 12:29 PM   #6
IT1
LQ Newbie
 
Registered: May 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
Turbocapiltilist, yes I also tried to change to the way you mention. Unfortunately still gives that same error code. Funny thing is the vpn tunnel was working few hours back but just now getting this error
 
Old 05-20-2016, 12:30 PM   #7
IT1
LQ Newbie
 
Registered: May 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
Sorry misspelled your name
 
Old 05-20-2016, 12:34 PM   #8
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,294
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
No worries.

Can you use a telnet client to check port 22? It won't get past the identification, but that will be enough to verify that you should be getting through to the SSH server.

Code:
telnet server.example.com 22
It should say something about SSH-2.0 and then the version of the SSH server.
 
Old 05-20-2016, 12:34 PM   #9
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
Originally Posted by pingu_penguin View Post
The error is connection "refused" , it means the connection was actively refused by the ssh server.

If the port wasnt open you would probably had a connection timeout.

refused can mean :

-> invalid username password combination
-> password / username expired
-> your IP / account has been banned/blocked.
Or SSH server not running, or using a different port
 
Old 05-20-2016, 12:53 PM   #10
IT1
LQ Newbie
 
Registered: May 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
It's strange. Good news is the vpn tunnel is working connection established now just the issue with ssh into a router, not responding. I could ping the dns server and got packets back
 
Old 05-20-2016, 12:55 PM   #11
Dennis99
LQ Newbie
 
Registered: Dec 2006
Location: Gorleston, Norfolk, UK
Distribution: Debian, Manjaro, Raspian
Posts: 18

Rep: Reputation: 10
Had this in the past, in my case it was a firewall issue.
Rectified as root using the command ufw allow ssh
 
Old 05-20-2016, 01:18 PM   #12
IT1
LQ Newbie
 
Registered: May 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
Dennis99 did you enter that command in root/vpn or just in root@xxxxxx
 
  


Reply



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 - Connection Refused eminence Linux - Networking 15 02-11-2020 09:48 AM
SSH Connection Refused jdwpv4 Linux - Networking 1 05-12-2015 11:43 AM
ssh connection refused kevinsn Linux - Networking 5 03-31-2008 03:48 PM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM
SSH connection refused bmccorm2 Linux - Networking 4 05-15-2007 02:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:56 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
Open Source Consulting | Domain Registration