How do I specify port number for PuTTY to use with Windows cmd?
I start most of my SSH connections with a windows command like this
cmd://"C:\Program Files\PuTTY\putty.exe" -ssh [email protected]
I assume this defaults to port 22. Now I need to connect on a different port. I tried
cmd://"C:\Program Files\PuTTY\putty.exe" -ssh [email protected]:xxx
(port number on the end) but it won't allow the connection. I know the port number and IP are correct because if I fire up PuTTY and start a session with these details I can get in fine.
p.s. If this is the wrong stackexchange for this question please don't destroy me, I did look for quite a long time before deciding to post here.
Solution 1:
Ok - I'm embarrassed. I just found the -P option which does exactly what I want.
cmd://"C:\Program Files\PuTTY\putty.exe" -ssh [email protected] -P xxx
is the correct syntax.