Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

cmd://"C:\Program Files\PuTTY\putty.exe" -ssh root@xxx.xx.xxx.xx

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 root@xxx.xx.xxx.xx: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.

share|improve this question

1 Answer 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 root@xxx.xx.xxx.xx -P xxx

is the correct syntax.

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

Your Answer

 
discard

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.