Figure out non standard ssh port

Solution 1:

Assuming you don't have access to command line (otherwise you would already know what the port number was), you can do a port scan to try and identify which port the SSH service is running on. I would suggest running nmap. There's no guarantee though that it will find it.

Solution 2:

Run nmap -sV <hostname/ip> - which is nmap with service detection, meaning it works out what's actually listening on the port, rather than guessing the service based on the port it's using.

This will give you output that looks something like:

PORT STATE SERVICE VERSION

666/tcp open ssh OpenSSH 5.3p1 Debian 3ubuntu4 (protocol 2.0)

If it still doesn't find the port, run nmap -p- -sV <hostname/IP> - this will scan all 65k ports - it's slower, but it will find it if it's running on a high up port.

Solution 3:

If you have access to the commandline, and read access to /etc/ssh/sshd_config, run

grep Port /etc/ssh/sshd_config