Operating System - Linux
1832988 Members
2649 Online
110048 Solutions
New Discussion

opening port 22 on redhat 3.0

 
keita_1
Occasional Contributor

opening port 22 on redhat 3.0

gurus,

Can anyone help me on how to open port 22 on my redhat 3.0 server?

This exercise is to enable me connect to my server from anywhere on the internet and not just from within my home.
Thanks
6 REPLIES 6
Alexander Chuzhoy
Honored Contributor

Re: opening port 22 on redhat 3.0

depends on how it's close.
First try to close the iptables totally:
service iptables stop


and make sure that the sshd is running (presumably installed).
service sshd status

if the status is "stopped"
then run service sshd start
hope it helps.
keita_1
Occasional Contributor

Re: opening port 22 on redhat 3.0

thanks Alex,

Is there a command to actually tell it to open the port after all what you have said is done? I know sshd is running definitely.
Alexander Chuzhoy
Honored Contributor

Re: opening port 22 on redhat 3.0

By default ssh daemon opens this port.

Unless the default was changed and there's no firewall-it should be open.
Try to telnet to that port and see if it's open....
Vipulinux
Respected Contributor

Re: opening port 22 on redhat 3.0

Hi

Check for the file /etc/services and see is port 22 commented..
also do
service sshd restart

then do
netstat -an | grep 22
to check the status.

also if iptables is blocking 22...do
service iptables stop
and try..

Cheers
Vipul
Manuel Wolfshant
Trusted Contributor

Re: opening port 22 on redhat 3.0

Keita,
a) first af all make sure that ssh is running (you can test that easily, just telnet localhost 22; if it's running you will see something similar to
Connected to localhost.
Escape character is '^]'.
SSH-1.99-OpenSSH_3.9p1
b) once this is OK, do NOT stop the firewall ( running service iptables stop). Instead use the firewall configuration tool (redhat-config-securitylevel) and allow ssh.
c) last but not least, once it's working (or even before it), if you have fixed IP addresses you will connect from, edit /etc/hosts.allow and add a line similar to:
sshd: 127.0.0.1 other.ip.add.res
and also in /etc/hosts.deny a line similar to:
sshd: ALL

If you do not have and do not wish to install redhat-config-securitylevel, you may take an alternate approach: just type in command line
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
and retest ssh. If it is OK, type
service iptables save
(so that the rule will be preserved in the future)
Marius Pana_1
Regular Advisor

Re: opening port 22 on redhat 3.0

Is it possible that it is not listening on port 22? Check /etc/sshd/sshd_config and verify the Port value..should be "Port 22" .

Good luck!

//Marius
"The Linux philosophy is 'Laugh in the face of danger'. Oops. Wrong One. 'Do it yourself'. Yes, that's it." --Linus Torvalds