Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I start most of my SSH connections with a windows command like this

cmd://"C:\Program Files\PuTTY\putty.exe" -ssh

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

(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.

share|improve this question
up vote 20 down vote accepted

Ok - I'm embarrassed. I just found the -P option which does exactly what I want.

cmd://"C:\Program Files\PuTTY\putty.exe" -ssh -P xxx

is the correct syntax.

share|improve this answer
Don't be embarrassed. I don't see any similar question tagged "putty" and "port", so your question and answer might help others. – user130370 Nov 15 '13 at 10:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.