Search code examples
windowssshputty

PuTTY autologin with custom SSH protocol handler in Windows


I'm trying to put an auto login in custom ssh:// protocol handler registered in the Windows registry. As soon as PuTTY interface gets open I want to log in automatically.

Is there a way to set in the code below the username and password? This code below will just open PuTTY, but I have to put by myself the username and password in the PuTTY interface.

Any ideas how to do it or may there is another or better way?

Thx for your support.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ssh]
@="URL:ssh Protocol"
"URL Protocol"="ssh://"
[HKEY_CLASSES_ROOT\ssh\shell]
[HKEY_CLASSES_ROOT\ssh\shell\open]
[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="cmd /V:ON /c set params=%1 && set params=!params:ssh://=! && start \"PuTTY\" \"c:\\Program Files (x86)\\PuTTY\\putty.exe\" \"!params:/=!\""

enter image description here


Solution

  • Use:

    [HKEY_CLASSES_ROOT\ssh\shell\open\command]
    @="cmd /V:ON /c set params=%1 && set params=!params:ssh://=! && start \"PuTTY\" \"c:\\Program Files (x86)\\PuTTY\\putty.exe\" \"!params:/=!\" -l username -pw password"