xinetd how to activate sshd service on custom port?

When I try to run ssh service in xinetd with customized port (port=2211) it shows me this error:

xinetd[16783]: Service ssh expects port 22, not 2211

If I change port to 22 in xinetd it works fine but how can I customize to use my port in xinetd?


Solution 1:

You'll need to make some modifications to the xinetd configuration - this is dealing with it on MacOS, but it's very similar.

You can go and modify the /etc/services file and change the port there, but it's probably better to create/modify an /etc/xinetd.d/ssh file and make sure to specify:

  • "-p XXX"
  • "port = XXX"
  • "type = unlisted"