Skip to Content

run sshd on different ports

Running sshd on multiple ports so that a gateway user will be assigned different shells on each port

In the example below, we will run multiple sshd daemon on different ports. The sshd servers will listen on port 22 and port 2244.   The users connecting on port 22 will be assigned the default port /bin/bash and users connecting to the port 2244 via ssh would be assigned to the ezsh shell. This would enable the Ezeelogin gateway user to have the option to login into a bash shell as well as the ezsh shell. Refer the article to Enforce ssh users to ezsh shell

Note: The users needs to be assigned the /bin/bash by default. It is possible to enforce users to switch to ezsh from bash and not vice versa.

root@gw vi /etc/ssh/sshd_config

Port 22
Port 2244

Match LocalPort 2244 User ?*

       ForceCommand /usr/local/bin/ezsh

root@gw service sshd restart