LinuxQuestions.org
Review your favorite Linux distribution.
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 04-01-2009, 05:52 AM   #1
ssenthilkumar
Member
 
Registered: Apr 2009
Posts: 38

Rep: Reputation: 15
Question problem with ssh


whenever i give ssh 192.168.20.165 pwd...

terminal is showing this message "ssh: connect to host 192.168.20.165 port 22: Connection refused"

any one please help me regarding this. (i am using debian)
 
Old 04-01-2009, 05:57 AM   #2
vlademir
Member
 
Registered: Jan 2009
Location: The Netherlands
Distribution: Centos,Ubuntu,Mandriva,Suse11.1
Posts: 86

Rep: Reputation: 17
Smile

Quote:
Originally Posted by ssenthilkumar View Post
whenever i give ssh 192.168.20.165 pwd...

terminal is showing this message "ssh: connect to host 192.168.20.165 port 22: Connection refused"

any one please help me regarding this. (i am using debian)
Please check if port 22 of your server is not blocked by the firewall or the router, if yes then forward the port 22 in your router and open port 22 on the firewall.
 
Old 04-01-2009, 06:16 AM   #3
maxy7710
Member
 
Registered: Jan 2008
Location: Mumbai, india
Distribution: REDHAT, FEDORA,SUSE, UBUNTU, ORACLE ENTERPRISE LINUX & SOLARIS 10
Posts: 130

Rep: Reputation: 17
Check whether sshd service is active on the server.
check whether ping is happening.
also check telnet with port 22 to see whether its blocked.
 
Old 04-01-2009, 07:03 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
It is refusing connections. That means either the port is blocked by firewall or ssh service itself is not running.
 
Old 04-02-2009, 12:21 AM   #5
ssenthilkumar
Member
 
Registered: Apr 2009
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by maxy7710 View Post
Check whether sshd service is active on the server.
check whether ping is happening.
also check telnet with port 22 to see whether its blocked.



Thx for ur reply...
ping is happening...
i dunno how to check with telnet. (provide me the syntax).. pls...
 
Old 04-02-2009, 12:28 AM   #6
ssenthilkumar
Member
 
Registered: Apr 2009
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by linuxlover.chaitanya View Post
It is refusing connections. That means either the port is blocked by firewall or ssh service itself is not running.

Thx buddy....
i think the port is blocked by firewall.. but i dunno how to check whether port is blocked, n i dunno how to open the closed port (commands i dunno).. can u pls send me, if u know and as u knew i am using debian...
 
Old 04-02-2009, 12:49 AM   #7
maxy7710
Member
 
Registered: Jan 2008
Location: Mumbai, india
Distribution: REDHAT, FEDORA,SUSE, UBUNTU, ORACLE ENTERPRISE LINUX & SOLARIS 10
Posts: 130

Rep: Reputation: 17
command for telnet

telnet 192.168.20.165 22

if u can login then port 22 is open.

when u say its blocked by firewall, u mean by OS firewall or physical firewall.

for OS firewall :- service iptables off

for physical firewall contact u r firewal admin & follow the procedure.

Mind you firewall is set for security, so it will be better if u just open port 22 which is required.
 
Old 04-02-2009, 12:55 AM   #8
bcromwell
LQ Newbie
 
Registered: Jun 2004
Posts: 10

Rep: Reputation: 0
Try the following on the SSH server

/etc/init.d/iptables stop
try to ssh
/etc/init.d/sshd start
try to ssh
netstat -ln | grep 22
Look for something like
tcp 0 0 :::22 :::* LISTEN

If you see that and if neither work then there is something between the client and the server is dropping port 22 ie firewall or nat issue.
 
Old 04-02-2009, 02:21 AM   #9
ssenthilkumar
Member
 
Registered: Apr 2009
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by maxy7710 View Post
command for telnet

telnet 192.168.20.165 22

if u can login then port 22 is open.

when u say its blocked by firewall, u mean by OS firewall or physical firewall.

for OS firewall :- service iptables off

for physical firewall contact u r firewal admin & follow the procedure.

Mind you firewall is set for security, so it will be better if u just open port 22 which is required.
buddy,

this is the message i m getting,when i give
telnet 192.168.20.165 22
Trying 192.168.20.165...
telnet: Unable to connect to remote host: Connection refused
 
Old 04-02-2009, 03:13 AM   #10
maxy7710
Member
 
Registered: Jan 2008
Location: Mumbai, india
Distribution: REDHAT, FEDORA,SUSE, UBUNTU, ORACLE ENTERPRISE LINUX & SOLARIS 10
Posts: 130

Rep: Reputation: 17
dude that means port 22 is not open on the server.

do service sshd restart on the server & then do

telnet 192.168.20.165 22

if it goes thru then u can do ssh
 
Old 04-02-2009, 05:06 AM   #11
ssenthilkumar
Member
 
Registered: Apr 2009
Posts: 38

Original Poster
Rep: Reputation: 15
so now i give the entire scenario..
sterday this was the scene

whenever i give ssh 192.168.20.165 pwd...

terminal is showing this message "ssh: connect to host 192.168.20.165 port 22: Connection refused"

so i tried everything that u guys told me, still i cannot open the port and ssh server is not installed in my system, ssh client is installed in my system..

i tried installing ssh server in my system, but it is displaying the error as,

(configure: error: *** zlib missing - please install first or check config.log ***)

so messed up.. not at all communicating any debian system, but it is communicating Red hat linux, if i use that same ssh..

so kindly help me...
 
Old 04-02-2009, 05:21 AM   #12
maxy7710
Member
 
Registered: Jan 2008
Location: Mumbai, india
Distribution: REDHAT, FEDORA,SUSE, UBUNTU, ORACLE ENTERPRISE LINUX & SOLARIS 10
Posts: 130

Rep: Reputation: 17
Check whether ssh service is active on all the servers u r referring.
 
Old 04-02-2009, 05:27 AM   #13
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
You do not need ssh server on every system. You will need it installed on the system that you are trying to ssh. It wont matter much which distribution it is running on. ssh server will run much the similar way. Just the starting and stopping of the service will differ.
 
Old 04-03-2009, 12:26 AM   #14
ssenthilkumar
Member
 
Registered: Apr 2009
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by maxy7710 View Post
Check whether ssh service is active on all the servers u r referring.
thanks ya.. now its working..
 
Old 04-03-2009, 12:27 AM   #15
ssenthilkumar
Member
 
Registered: Apr 2009
Posts: 38

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by linuxlover.chaitanya View Post
You do not need ssh server on every system. You will need it installed on the system that you are trying to ssh. It wont matter much which distribution it is running on. ssh server will run much the similar way. Just the starting and stopping of the service will differ.
thanks ya.. now its working..
 
  


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
Chroot SSH problem: ssh working, not SFTP & SCP. NaCo Linux - Security 3 02-01-2009 03:23 AM
ssh-agent, ssh-add and ssh-keygen AND CVS raylpc Linux - General 2 11-19-2008 03:50 AM
SSH problem - ssh-add not respond FerkoPica Linux - Security 6 05-07-2006 04:47 PM
ssh problem after creating an ssh alias. porotothorpe Linux - General 2 01-25-2006 08:56 PM

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

All times are GMT -5. The time now is 12:44 PM.

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