sshd listening on more than one port.

Daniel Bye freebsd-questions at slightlystrange.org
Thu Mar 31 06:58:45 PST 2005


On Thu, Mar 31, 2005 at 11:29:29AM +0100, Mick Walker wrote:
> Hello,
> 
> I am wanting to know if it is possible to enabled the sshd to listen on
> more than one port, without having to spawn another instance of the
> server itself.
> If it is possible does anyone have any idea how I could accomplish this.

Yes, it is possible - this is from man sshd_config:

     Port    Specifies the port number that sshd listens on.  The default is
             22.  Multiple options of this type are permitted.  See also
             ListenAddress.


I have just tested it - your sshd_config needs to include something like
this:

Port 22
Port 2222

etc.

It works just fine:

# sockstat -4l | grep sshd
root     sshd       38948 3  tcp4   *:2222                *:*
root     sshd       38948 4  tcp4   *:22                  *:*

HTH

Dan

-- 
Daniel Bye

PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc
PGP Key fingerprint: 3B9D 8BBB EB03 BA83 5DB4 3B88 86FC F03A 90A1 BE8F
                                                                     _
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20050331/2dbf6ab7/attachment.bin


More information about the freebsd-questions mailing list