2

This question already has an answer here:

How can I limit sshd to only listen on given interface when using OpenBSD 5.3?

marked as duplicate by slm, jasonwryan, Renan, rahmu, Rahul Patil Oct 5 '13 at 11:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @slm I wouldn't consider that a duplicate. It just happens to use sshd for the example. – jordanm Oct 5 '13 at 2:01
4

See the sshd_config man page:

ListenAddress

Specifies the local addresses sshd(8) should listen on. The following 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.

More generally, for ssh and sshd, note that the documentation is split between sshd(8), ssh(1), sshd_config(5) and ssh_config(5),

  • so I have to use pf to only allow sshd to listen on given interfaces? – gasko peter Oct 5 '13 at 17:01

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