It's Easy to Setup SSH Daemon on Multiple Ports
I manage multiple servers. Today, I had the problem of providing external SSH access to multiple servers behind a firewall gateway. The solution I decided on is to configure each server to run SSH daemon on two ports: 1) the standard SSH port (22) for internal access; and 2) a secondary SSH port for internal/external access. The firewall gateway will forward incoming SSH request to the secondary SSH port.
My first headache was to figure out how to run two multiple instances of SSH daemon. But I found that SSH implementers had already thought of that and done the work. All you and I have to do is to update the sshd_config with multiple ports.
For example, on Ubuntu 7.04, the configuration file is located at "/etc/ssh/sshd_config". Use the "sudo vi /etc/ssh/sshd_config" to add the port(s). The following code sample shows SSH daemon configured to bind to two different ports.
# What ports, IPs and protocols we listen for
After you've added the ports, you can either restart the server or restart sshd on the command-line. Use the following command to restart on the command-line:
sudo /etc/init.d/ssh restart
It will, of course, kill your SSH session. You can work-around that by using Telnet (see "Installing Telnet Daemon on Ubuntu"). After you restarted the SSH daemon, you can now access SSH on two different ports.
The example shown here is for Ubuntu 7.04. But Ubuntu is just another Linux flavor. So setting up SSH on multiple ports for other UNIX/Linux distributions will be the same or very similar to the example in this article.
Did your message disappear? Read the Forums FAQ.
Spam Control | * indicates required field
TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.
No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.
Messages, files, and images copyright by respective owners.
44 Users Online
Copyright © 2004 - 2021. All Rights Reserved.