Contents[Show]

1. Intro

Sometimes you need to test ssh connections and doing it on a secondary ssh port may make sense.

 

2. Guide

Start the secondary ssh daemon on homeserver.com.

# /usr/sbin/sshd -p 2222

 

Then initiate a test connection from the client.

# ssh -vv This email address is being protected from spambots. You need JavaScript enabled to view it. -p 2222
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "homeserver.com" port 2222
debug2: ssh_connect_direct: needpriv 0
...

 

You're likely to see the problem near the bottom.

 

3. Sources

https://serverfault.com/questions/826893/how-to-temporarily-run-a-secondary-ssh-server-on-a-separate-port

https://access.redhat.com/solutions/1166283

https://ubuntuforums.org/showthread.php?t=1497376