How to recover WinSCP stored password?

When setting up a new site in WinSCP, you have the option to save your password so you won’t be prompted to input  a password to login the site. This is convenient in most cases except you want to retrieve the password but forget it. How to get the password WinSCP stored for sites? You cannot read the site password on the WinSCP login window. You can get the user name, but the password is displayed as asterisks. You must think WinSCP stores the password somewhere on your computer. Yes, WinSCP does save the password information in the registry or the WinSCP.ini file in the installation directory. But if you open WInSCP.ini to find the password, you’ll be disappointed because all passwords are encrypted as a long sequence of hexical  digits. I don’t know how to decrypt the digits to uncover the password. I searched the Internet for a method to get the password but some methods just do not work. For example, this post says you can set the “Log passwords and other sensitive information” in the preference option. But I cannot see this option in my preference. Maybe my WinSCP has a different version(5.5.5) from his. This post suggests to use a tool called  Winscppwd to recover the password from WinSCP, which seems too hard to do. In the end, I found a method to restore the password without using another tool.

  1. First, you need to login to  the site.
  2. Click the menu Options/Preference/Integration/Application, change the PuTTY path to a file(echo.cmd) you’ll create later. Tick the “Remeber session password and pass it to PuTTY” check box. Click OK.
  3. Create the file echo.cmd to include the following content:echo %*
  4. Click the menu Command/Open in Putty, which will execute the script echo.cmd and the password will be shown as an option(-pw) to the echo command. Note that the user name won’t be shown here but as I said before, you can get the user name from the login window of WinSCP.


There is another solution to get the lost password in the same post:Click the “Session/generate URL” menu, check username and password options, click on “copy to clipboard”. Unfortunately, I cannot find these menu options maybe due to my WinSCP version.

I also tried to open session log/save to log file in Options/Preference/log, and check “remember password in session” in Options/Preference/Security. But it does not work. I checked the log file and noticed the line “Prompt (7, SSH password”, but the password was not shown there.

Posted in tips of hosting