Portal Home > Knowledgebase > Articles Database > Forgot SSH Port


Forgot SSH Port




Posted by Rezaa, 12-18-2010, 03:03 AM
Hello, Unfortunately I forgot my SSH port. How can I get it back?

Posted by Martyn-ISN, 12-18-2010, 03:06 AM
i connect through putty at 20

Posted by Rezaa, 12-18-2010, 03:09 AM
the default ssh port is 22 I've changed it to protect it against brute force attacks. but now I forgot it

Posted by KMyers, 12-18-2010, 03:18 AM
Ummm, thats not a good thing. If you have a PHP/Perl/etc script, you may be able to read the contents of /etc/ssh/sshd_config Another option is to have the DataCenter perform a local login to see the port.

Posted by Mark Muyskens, 12-18-2010, 03:22 AM
Is this an actual server or VPS? Do you have console access?

Posted by Rezaa, 12-18-2010, 03:23 AM
I found it I forgot to add the port to the firewall lol thanks anyway

Posted by xtrac568, 12-18-2010, 07:34 AM
for others, if you forget the port, you can try probing your server with e.g. nmap tool to get idea on available ports.

Posted by Rezaa, 12-18-2010, 07:42 AM
can you explain your method? how do I get available ports via nmap? thank you

Posted by Johnny Cache, 12-18-2010, 09:41 AM
Nmap is basically a security auditing tool. In short, after you install it (Winderz or *nix environments) you can input your IP into this tool and it will scan the target system for open/closed ports and what ports particular daemons are running on. http://www.nmap.org You can also use this web-based port scanner: http://mxtoolbox.com/SuperTool.aspx?...n:216.99.213.1 The IP is one I picked out of the blue. Just replace it with your IP and it will do a port scan on your machine.

Posted by HarrySX, 12-18-2010, 09:50 AM
Thought I'd contribute for user's that experience this in future that are using cPanel. WHM offers a tool to restart SSH in "safe mode" that can resolve these problems.

Posted by guru4hosting, 12-18-2010, 10:31 AM
yes HarrySX is correct!. But it needs to be a cpanel server

Posted by CoolKoon, 12-18-2010, 08:21 PM
Also, the OP and others might want to keep in mind that none of the external methods (port scans and the like) could've been used to help the OP with his problem, since forgetting to have the firewall open the port means that it won't show up in any (external) port scan except the ones initiated locally from within the OS itself (e.g. by running "nmap 127.0.0.1 -p1-65535" on the server if you prefer nmap). So if you have no other means than SSH to access the server, you can pretty much lock yourself (and everyone else) out of it.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
CrucialWebHost Review (Views: 771)

Language: