Portal Home > Knowledgebase > Articles Database > need to enable one IP for port ssh2200
need to enable one IP for port ssh2200
Posted by jeffbright, 12-18-2008, 12:51 PM |
need to enable one IP for port ssh2200
Guys today I installed my csf firewall
Any body can tell me how to enable just a set of ips
for port 2200?
I need a few ips be there which can have access only through
ssh2200
that is all
thanks a lot
|
Posted by jaseeey, 12-18-2008, 09:02 PM |
I don't think it's the case of allowing a specific port on a specific IP, but it's more the case of the server listening on a specific IP. I assume it is SSH you wish to do this, you can find this option in the configuration of SSHD.
|
Posted by jaseeey, 12-18-2008, 09:16 PM |
Firstly, enable the port in your firewall configuration.
In the file, /etc/ssh/sshd_config, you will see many lines. To listen on multiple IPs, you need to duplicate the ListenAddress setting like so:
Code:
ListenAddress 1.2.3.4
ListenAddress 1.2.3.5
ListenAddress 1.2.3.6
For each IP, you add a new line. If the ListenAddress settings are commented out or not there, it will listen on all IPs.
P.S. Don't forget to restart the SSHD service
Last edited by Jaseeey : 12-18-2008 at 08:22 PM.
|
Posted by zacharooni, 12-18-2008, 09:22 PM |
You can enable SSHD on another port by adding another Port directive like so:
Port 2050
(for example)
Then, you can add firewall rules like this:
iptables -I INPUT -s IP.IP.IP.IP -d IP.OF.SSH.SERVER -p tcp --dport 2050 -j ACCEPT
iptables -I INPUT -s IP2.IP2.IP2.IP2 -d IP.OF.SSH.SERVER -p tcp --dport 2050 -j ACCEPT
iptables -I INPUT -d IP.OF.SSH.SERVER -p tcp --dport 2050 -j DROP
|
Posted by jeffbright, 12-19-2008, 04:31 AM |
Guys today I installed my csf firewall
Any body can tell me how to enable just a set of ips
for port 2200?I need a few ips be there which can have access only through ssh2200
I use SCF , the scp must have configuration to do it
|
Add to Favourites Print this Article
Also Read