HTML code to open PuTTY client from browser

后端 未结 2 912
难免孤独
难免孤独 2020-12-17 02:52

I am trying to make a webpage which will have the entire inventory of servers that our team manages in the form of a table. I am using a simple LAMP stack and the inventory

2条回答
  •  囚心锁ツ
    2020-12-17 03:12

    I've done it following the info of this blog post.

    For future reference in case the original page becomes missing, here is the process:

    1. you cannot directly map the ssh:// scheme to PuTTY, but you can map it to an intermediary script which will in turn lanch PuTTY with the right arguments. Mine is called putty_ssh.bat and has the following content:

      @echo off
      set var=%1
      set extract=%var:~6,-1%
      "C:\Program Files (x86)\PuTTY\putty.exe" %extract%
      
    2. the script has to be registered in the registry. You can just create a ssh.reg file with the following content and open it (customizing last line as needed):

      REGEDIT4
      [HKEY_CLASSES_ROOT\ssh]
      @="URL:ssh Protocol"
      "URL Protocol"=""
      [HKEY_CLASSES_ROOT\ssh\shell]
      [HKEY_CLASSES_ROOT\ssh\shell\open]
      [HKEY_CLASSES_ROOT\ssh\shell\open\command]
      @="\"C:\\path\\to\\putty_ssh.bat\" %1"
      

    When I click on ssh:// links in web pages, it now opens PuTTY.

提交回复
热议问题