Super User is a question and answer site for computer enthusiasts and power users. 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

Is there a way to configure a password for a stored session in PuTTY?

I know there is the capability to specify an "auto-login username" (under Connection/Data), but is there a way to do the same with the password?

share|improve this question
Use KiTTy... its developed using PuTTy source code.. – Evil Angel Apr 13 '12 at 12:52
use key pairs, not passwords – ladieu Nov 21 '14 at 15:21

14 Answers 14

up vote 229 down vote accepted

For some versions of PuTTY, it's as simple as one of :

putty.exe -pw mypassword
putty.exe -l mylogin -pw mypassword

If you want to connect using SSH, use this:

putty.exe -ssh -pw mypasswordforsomewherecom

For those using Windows, you can simply create a shortcut and pass in these parameters.
For example:

  1. Create a shortcut on the desktop to putty.exe
  2. Rename the shortcut to PuTTY -
  3. Right-click shortcut and choose Properties
  4. Modify the target similar to:
    "C:\Program Files\PuTTY\putty.exe" -pw password
  5. Click OK

If your PuTTY does not support the pw parameter, you will need a public key as explained in :
Creating and Copying Your Key-Pair in PuTTY SSH Client.

share|improve this answer
harrymc's answer is the best option. The Putty FAQ makes it clear there's no way in the settings to store a password – Dave Webb Sep 20 '09 at 12:00
Great tip, I now have a set of desktop links to our dev servers! Very useful. – aglassman Aug 23 '13 at 15:48
@aglassman and others - you do of course value your servers etc security... storing passwords unencrypted is genrally not a great idea, RSA keys is the way to go. Do use it for access for things like Raspberry Pi where i don't care who uses it - thanks! – Wilf Apr 12 '14 at 10:16
The question wasn't whether one should or shouldn't, it was "how". – harrymc Apr 23 '14 at 15:55
Lol, this answer would never fly in info security... Which is exactly why it belongs on superuser :) – Sun Sep 27 '14 at 14:24

Strongly advise using the public key mechanisms rather than sending passwords from the shell.
Here is one more reference for the setup.

Link to get latest PuTTY binaries (and check the FAQ).

share|improve this answer
+1 for the right way. Storing passwords in plaintext anywhere is a poor idea. – Zac B Dec 3 '12 at 18:45
@nik Don't get me wrong, You're right. But this is superuser site, if I want to auto login with password You may assume I have a good reason to do it. – matt Jan 15 '14 at 18:11
@ZacB - I am new to security. If an attacker has root access to your system, then can't he just log all your keystrokes, record your videos etc and get all your logins and such anyway ? Of course, plain text storage removes the need for the attacker to put all that effort, right ? – Steam Dec 8 '14 at 21:59
@Steam: you're right, a compromised system is a Really Bad Thing. But that's no reason not to have secondary (post-breach) threat protection. If a system is compromised at the root level, it should be as hard as possible for the attacker to compromise other parts of your infrastructure, and as likely as possible that they will be detected when doing so. Getting a keylog requires a sustained (more likely to be detected) intrusion and the installation of noticeable new software. Stealing a text file does not. – Zac B Dec 9 '14 at 13:59
I was on the corporate VPN when I tried to download PuTTY from that site, and I was prevented because it contained a virus! – OmarOthman Mar 20 at 13:37

If you want to preserve saved options (such as pre-configured window sizes and tunnel proxy) and load a saved session to auto-login, use this approach:

putty.exe -load my_server -l your_user_name -pw your_password

Where 'my_server' is a saved session name.

share|improve this answer

I use mRemote on Windows; it can store usernames and passwords for SSH, RDP, VNC and Citrix.

share|improve this answer
+1 Nice application! – Matěj Zábský Oct 17 '11 at 12:59
I found this pretty buggy on Win7. Dragging the window around caused major hangs. Shame because apart from that it is great. – jsims281 Jan 11 '12 at 16:51

PuTTY Connection Manager is a separate program that works with PuTTY. It can autologin and has an encrypted database holding the passwords.

I still prefer SSH keys though.

(Another downside is that it may no longer be supported by its original developer(s), and may only be available to download from 3rd party sources.)

share|improve this answer

Tunnelier - saved passwords encrypted locally. It also has a sFTP GUI as well as SSH windows.

enter image description here

share|improve this answer

Yes, there is a way. Recently I added a password saving feature for PuTTY 1.5.4 for both Linux and Windows. You can download binaries and source from Oohtj: PuTTY 0.62 with a password saving feature.

share|improve this answer

I prefer doing like this on a Windows machine. Save the PuTTY executable in a folder, say "mytools", and run this command from command prompt:

tools>mytools 10 

10 is the last octet of your IP address. That's it.

set PUTTY=E:\tools\putty.exe
start %PUTTY% root@192.168.1. %1 -pw yourpassword
share|improve this answer
Perfect. But by doing this, all of color customizations are gone and I am stuck with native PuTTy ugly color-scheme. I have added these reg files as my color scheme but can i use it somehow ? – Em Ae Feb 21 '13 at 17:57

If you use the following way, don't forget to add "" to enclose your session name, or it may fail to load the session. For example,

putty.exe -load "my session name", 

The general form is:

putty.exe -load my_server -l your_user_name -pw your_password
share|improve this answer

There's a port of putty called kitty which allows saving username / password

The kitty_portable.exe is very handy, no installation needed

share|improve this answer

If the connection is authenticated by public key and password, consider using Pageant.

You can add your private keys to Pageant with the associated password. Assuming you've got the correct username configured in PuTTY, you will authenticated transparently.

It doesn't store your passwords so you'll have to re-add your key next time you launch it. There is a command line option to launch and add keys in one go.

"C:\Program Files\PuTTY\Pageant.exe" key1.ppk key2.ppk key3.ppk

It will prompt for a password if required

And the best of all, It's part of the PuTTY suite, so you've probably already got it on your machine.

share|improve this answer

I use WinSCP to “auto login” in PuTTY with a password. It's free, contains plenty of features, was created in 2000 and is still activity maintained. (WinSCP Wikipedia page)

enter image description here

Opening PuTTY from WinSCP can be done from either the login window, or from the SFTP window, which I find extremely handy:

enter image description here

enter image description here

share|improve this answer

If the command history is a security concern, go the public key route (as your plaintext password specified in the -pw option is stored in the command history).

share|improve this answer

Install MTPuTTY and your problem should be solved. You can even execute a bunch of scripts after logging into Putty.

share|improve this answer

You must log in to answer this question.

protected by Karan Apr 24 '13 at 21:46

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .