You are here

Putty and Pageant automation

5 posts / 0 new
Last post
mlun
Offline
Last seen: 11 years 6 months ago
Joined: 2008-11-05 03:34
Putty and Pageant automation

Everytime I start Windows I have to do this tedious work:
1) Start Pageant.exe
2) Add a key to pageant (locate file, choose it, key in password. Enter)
3) Start Putty.exe
4) Select, Load and open the session needed.

Puh!!

Just wonder if someone has bothered to find a way to automate this, but haven't been able to locate a solution. Most threads are 2-3-4 years old, so seemingly no-one is any longer logging in to their servers using SSH!?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 8 months ago
Joined: 2007-04-15 21:08
How I do it:

I use ssh regularly, occasionally for an interactive session but more commonly for pushing and pulling from Mercurial repositories.

I have "pageant" set up as a doskey macro which launches pageant with the key file name as an argument. Then I have "putty" which is also a doskey macro to run PuTTYPortable.exe. I have PuTTY running even when I'm just using pageant for hg because otherwise it wants you to add the fingerprint of the remote machine every time, but PuTTY Portable backs up and saves that part of the registry.

You could also do it with a batch file in the PATH to run both at once:

%d0\PortableApps\PuTTYPortable\App\PuTTY\pageant.exe %d0\Documents\Keys\mykey.ppk
%d0\PortableApps\PuTTYPortable\PuTTYPortabe.exe

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Jimbo
Offline
Last seen: 5 years 1 month ago
Joined: 2007-12-17 05:43
You can go one step further

the pageant.exe command takes a -c parameter of the command to run after startup

%d0\PortableApps\PuTTYPortable\App\PuTTY\pageant.exe %d0\Documents\Keys\mykey.ppk -c %d0\PortableApps\PuTTYPortable\PuTTYPortabe.exe

should load pageant, install the key, prompt for its passphrase, and then run putty.

Second run of the same command will make pageant reload the key, which it will skip as it is loaded already, and just fire up a new putty session.

rangaroo
Offline
Last seen: 14 years 1 week ago
Joined: 2008-11-14 22:38
Kitty

http://www.9bis.net/kitty/?page=Welcome&zone=en

Try Kitty : it's afork of Putty that answers a lot of requests people have made over the years.
Designed to be easily portable.

otheus
Offline
Last seen: 5 years 7 months ago
Joined: 2008-06-06 07:04
Yeah, @rangaroo, Kitty

Yeah, @rangaroo, Kitty suffers from the same problem -- the kageant isn't even distributed with the portable version (as of 0.65 of putty); further, the kitty team doesn't publish the crypto hashes anywhere, so who knows what software we're actually getting (unless I want to bother with compiling).

Log in or register to post comments