Take the 2-minute tour ×

so I use a shortcut to load a session from user/password on default port like so below:

.\putty.exe root@212.83..-pw PASSWORD

I have changed my SSH port on the server from 22, to something else. How can I make that shortcut load on a port too? like Ex: -port 09?

Also, inside a batch file can I make it load a putty session like so above and send a command?


share|improve this question
Can't you just append the port after the address? Like username@address.of.host:09 –  TheZ Nov 9 '12 at 17:46
@TheZ I tried that, didn't work. I'll try again. –  MikeJones Nov 9 '12 at 17:52
add comment

closed as off topic by Charles, Yan Berk, Jason Heine, Nimit Dudani, NullPoiиteя ღ Nov 9 '12 at 19:54


1 Answer

up vote 3 down vote accepted

Create a putty profile in a saved session, and then call it from the command line like:

putty.exe -load my_putty_profile

It is possible to put ssh remote commands in the profile (under Connection | SSH).

Specify the port in the profile, or alternatively, use the -P port command-line argument.

share|improve this answer
Thank's but I don't under stand "profile", here is my UI i.imgur.com/vpIWe.png –  MikeJones Nov 9 '12 at 18:35
Ahaha, I'm such a moron, I tried -p port# and it didn't work, but I just tried -P port# (Capital "P") and it worked. Thanks. –  MikeJones Nov 9 '12 at 18:39
When you start PuTTY from the GUI, you get a PuTTY Configuration dialog. This is where you have a Category panel that has a lot of configuration options. If you set up your options, you can save them by going to Session and by creating a Saved Session. I guess then, in PuTTY terminology, what I am calling a profile is a saved session. Whatever name you give the saved session is the name put after the -load argument. –  kbulgrien Nov 9 '12 at 19:09
Sorry, I am unable to view pictures from that domain from my network. The domain is blocked for me. –  kbulgrien Nov 9 '12 at 19:11
add comment
