25 Apr 2014 
Support Center » Knowledgebase » How to setup SSH to listen on multiple/one IP and Ports
 Login [Lost Password] 
Email:
Password:
Remember Me:
 
 Search
 Article Options
 How to setup SSH to listen on multiple/one IP and Ports
Solution This can be a very easy task if you know how to do it correctly and follow my steps EXACTLY as I show them to you. First thing you want to make sure nothing is going to be blocking the port(s) and/or IP(s) you want to use for SSH (firewalls etc). Once you have made sure nothing will restrict SSH access then you may proceed. You will want to open up /etc/ssh/sshd_config (if your sshd_config is somewhere else because you installed it from /usr/ports you will need to open the one that pertains to the SSH application you run). You will see in the file that there is something similar to this:

#Port 22
#Protocol 2
#ListenAddress 192.168.1.1
#ListenAddress ::

You will need to be root to edit the file to read like this in order for it to be on the particular IP(s) of your choice and the particular Port(s) of your choice:

Port 22
Port 35353
Port 35354

ListenAddress 5.5.11.11
ListenAddress 5.5.11.12

This config will listen on both 5.5.11.11 and 5.5.11.12 on all three of those ports. You will notice you have to have a completely seperate entry for each port and address. This is not true with all BSD/Unix programs but it is with this particular program (openssh). If you wanted SSH to listen on all addresses you could just leave "ListenAddress" commented out (With a # in front of it). There are many other great options with openssh but I would not suggest you blindly change options without first reading about what they do.

After you have edited the config file you will save it and exit out. You need to find the PID of the SSHD process to kill it and it alone. Type "ps aux | grep sshd" and find the sshd process which should look something like this:

root 75830 0.0 0.1 2656 1792 ?? Is 22Apr06 1:01.30 /usr/sbin/sshd




Article Details
Article ID: 106
Created On: 13 Jun 2007 07:21 PM

 This answer was helpful  This answer was not helpful

 Back
Home | Register | Submit a Ticket | Knowledgebase | Troubleshooter
Language:

Help Desk Software Help Desk Software By Kayako SupportSuite v3.70.02