LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 01-06-2012, 03:46 AM   #1
macd909
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Rep: Reputation: Disabled
SSH working locally but not remotely on Red Hat Enterprise Linux


Hello Everyone,

I am new to linux and I am trying install red hat enterprise onto a spare dell power edge server that I have and enable a remote SSH connection to the box.

This is a fresh install of red hat enterprise and the SSH doesn't appear to be working remotely. I am attempting to connect directly from my laptop so the issue doesn't lay with port forwarding on my router.

I am using NMAP to port scan the box and it is showing that no ports are open at all, even after disabling iptables completely.

When I run service --status-all

I can see the Open SSH daemon is running and when I try SSH local to the machine 'ssh root@localhost' it lets me log in.

I have added to the host.allow file the text SSHD= ALL and checked that there is nothing in the host.deny.

The port scan shows port 22 is closed and thus when I try to SSH using putty from my laptop, the connection is refused.

Any help / suggestions would be greatly appreciated!

Thanks,

Greg.
 
Old 01-06-2012, 03:53 AM   #2
allez
Member
 
Registered: Jul 2008
Location: Russia/Siberia/Krasnoyarsk
Distribution: SuSE, CentOS, FreeBSD
Posts: 77

Rep: Reputation: 21
Well, it would be not bad to look at your /etc/ssh/sshd_config and output of the iptables -L command.

Last edited by allez; 01-06-2012 at 03:54 AM.
 
Old 01-06-2012, 08:44 AM   #3
novice06
Member
 
Registered: Mar 2006
Location: Singapore
Distribution: RHEL, CentOS
Posts: 132

Rep: Reputation: 23
Make sure below line is at /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 22 -j ACCEPT
 
Old 01-06-2012, 09:53 AM   #4
macd909
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi,

Here are the outputs:

root@pdl release]#iptables-L
Chain INPUT (policy ACCEPT)
targer prot opt source destination

Chain FORWARD (policy ACCEPT)
targer prot opt source destination

Chain OUTPUT (policy ACCEPT)
targer prot opt source destination

I am also now running a web server with the same issue.. So it doesn't look like it affecting the SSH service only. I also opened NC to test only port 999 and wasn't able to view it as open with the remote port scanner.


-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 22 -j ACCEPT was already in /etc/sysconfig/iptables.


Thanks,

Greg.
 
Old 01-06-2012, 10:24 AM   #5
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
i dont know if this will make a different or not but in our /etc/hosts.allow we use format


sshd:ALL

Although if your /etc/hosts.deny file is empty it shouldn't matter.

Check /etc/services file and make sure ssh is listed in there like:

ssh 22/tcp
ssh 22/udp


Have you tried disabling iptables to see if it works that way?

Last edited by kbscores; 01-06-2012 at 10:31 AM.
 
Old 01-06-2012, 12:08 PM   #6
saifelyzal
LQ Newbie
 
Registered: Jun 2011
Distribution: Redhat
Posts: 28

Rep: Reputation: Disabled
cat you telnet to the box with port 22 to make sure is your service runing and try it with both hostname and ip address. it sound like having problem reaching the box, and check your ip address config

Last edited by saifelyzal; 01-06-2012 at 12:11 PM.
 
Old 01-07-2012, 12:50 AM   #7
novice06
Member
 
Registered: Mar 2006
Location: Singapore
Distribution: RHEL, CentOS
Posts: 132

Rep: Reputation: 23
could it be there is firewall between your server and client? You may analysis with tcpdump util too
e.g
tcpdump -vv -i eth0 port 22
 
Old 01-08-2012, 08:00 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
As mentioned in post #2, post /etc/ssh/sshd_config. Specifically check the ListenAddress entry, although others may be important also.
 
  


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
[SOLVED] mouse right click not working in red hat enterprise linux piyusharora420 Linux - General 7 01-07-2011 12:47 AM
Mouse not working in Red HAT LINUX Enterprise 5 divyshorey Linux - Laptop and Netbook 1 04-26-2010 10:51 PM
Commands not working in Red Hat Linux Enterprise 5 anis_huq Linux - Newbie 3 08-18-2009 11:33 PM
start red hat linux box remotely, not login, ssh .... karinem Linux - Newbie 5 05-18-2009 10:02 AM
Login Screen not working. Red Hat Enterprise Linux 3 WS Dan37290 Linux - Enterprise 0 11-03-2006 04:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:08 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