GearHack

: :

Add Comment | Related Links | TrackBack
Related Content

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
Port 22
Port 34567

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.

Chieh Cheng
Tue, 06 Apr 2010 18:18:25 +0000

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Answer of 2 + 8?
Click button only once, please!

TrackBack

TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.

Send Ping | TrackBack URL | Spam Control

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.


Articles | Wiki
Forums | Latest | RSS
Library | Links | News
Search | Store | Help

241 Users Online



Hacking Digital Cameras
Fun for Photographers

Amazon Associate

Copyright © 2004 - 2024. All Rights Reserved.