Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Well, I need use multiple and distinct ports where sshd will be listening, for distincts clients. Each client connect a different ssh port in real time.

Can I put sshd service listening on multiple ports? Something like a port range in sshd config file ?

Thanks in advance.

share|improve this question

migrated from stackoverflow.com May 20 '13 at 12:34

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

up vote 1 down vote accepted

See man-page of sshd-config:

ListenAddress Specifies the local addresses sshd(8) should listen on. The fol- lowing forms may be used:

ListenAddress host|IPv4_addr|IPv6_addr
ListenAddress host|IPv4_addr:port
ListenAddress [host|IPv6_addr]:port

If port is not specified, sshd will listen on the address and all
prior Port options specified.  The default is to listen on all
local addresses.  **Multiple ListenAddress options are permitted.**
Additionally, any Port options must precede this option for non-
port qualified addresses.

Edit

Port

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

share|improve this answer
1  
But, you should note that by default maximum number of listening ports for sshd is 256. –  Nickolay Olshevsky May 20 '13 at 9:33
    
so, but can I use Port 22 Port 25980 Port 25981 Port 25982 , etc. I need not qualified address only. There is no limits in ports number? –  ManuParra May 20 '13 at 9:39
1  
See my edit, you can define multiple Port entries. –  j.holetzeck May 20 '13 at 9:43
    
256 ports are more than enough –  ManuParra May 20 '13 at 10:52
    
You can have more than 256 by starting a separate instance of sshd, with it's own config file and ports-list. –  Don Simon May 20 '13 at 14:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.