Running SSHD on 2 ports?

Hi,

I need to run SSHD on 2 ports on my Gentoo Linux server.

From the top of the config I grabbed this which should tell you what version I'm using.
'OpenBSD: sshd_config,v 1.69 2004/05/23 23:59:53 dtucker Exp'

Why do I need it on 2 ports? So for internal access I can still connect to 22, and from externally (since my router does not allow routing from one port to a different port, I would like to use a different port number so it's less likely to be hacked.

Cheers,

Paul.
H4InfAsked:
Who is Participating?
 
pablouruguayCommented:
iptables can do that
for example
iptables -t nat -A PREROUTING  -p tcp -d 0/0 --dport 2222 -j DNAT  --to 192.168.1.1:22

all connection make to port 2222 go to 192.168.1.1 port 22 for example
0
 
H4InfAuthor Commented:
Fantastic! That was easy.

I also discovered in my searches that you can enter 2 Port lines into the sshd_config file - and it will run on both.

Either way does the trick! Cheers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.