Configuring SSH to listen on two different ports at once
Hi there, ok here's the dealio.
I am running a webserver/router on Slackware 10.2 Now at school I can't ssh in because the firewall drops outbound packets on port 22. So what I'd like to do is run SSH on both ports 22 and 23 (or any unfiltered port for that matter) Now the problem is I'm not sure how to write that out in the confg files, and I don't want to drag my 100lb CRT keyboard and mouse over to it just to do some config file trial and error. So does anyone know how to write (if it even is possible) in the sshd_config file to listen on 2 ports? Would it be something like Port 22 , 23 or maybe Port 22 23 or Port 22,23 I really don't know and I don't want to risk crapping out ssh and having to drag the server around just to fix it. Also since I use it as a router, would it just be easier to set an iptables rule to forward all packets recieved on port 23 to 127.0.0.1:22 and if so would the rule have to look something like this? Code:
iptables -p tcp -t nat -A PREROUTING -i ppp0 --dport 22 -j DNAT --to-destinatination 127.0.0.1:23 |
I recall reading somewhere that it would be:
Code:
Port 22 |
You can also start up two instances of sshd, each with different config files that tell them to listen on different ports. Port 23 may be filtered since telnet uses it, so you may want to try something higher.
|
Per the OpenSSH sshd_config manpage,
Quote:
|
yup its
port 22 port 23 thanks homes |
All times are GMT -5. The time now is 12:21 PM. |