我想要一个我正在开发的网站,在ssh://0.0.0.0类型网址上打开PuTTY.我在Chrome和Firefox中使用此功能,但在Internet Explorer中出现以下错误:
Windows cannot access the specified device,path,or file. You may not have the appropriate permissions to access this item.
其次是:
Unable to open this helper application for ssh://0.0.0.0/. The protocol specified in this address is not valid. Make sure the address is correct,and try again.
这是我的注册表项:
Windows Registry Editor Version 5.00 [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] @="cmd /k set in=\"%l\" & call set in=%%in:ssh:=%% & call set in=%%in:/=%% & call \"C:\\Program Files (x86)\\PuTTY\\putty.exe\" %%in%% & exit"
我做了一个快速实验,看起来问题是由于cmd和调用.一旦我删除它们,我就会得到预期的结果.但是,我仍然需要将字符串操作作为PuTTY(对于使用RealVNC VNC Viewer的vnc url,情况相同)只需要没有协议前缀的主机.
编辑:它似乎只是导致问题的cmd. call可以与预期的行为一起使用.
解决方法
我想Internet Explorer调用cmd.exe存在权限问题.相反,我不得不完全开始使用PowerShell.这是工作的注册表项,绝对没有其他脚本或PuTTY程序修改,在我在网上找到的一些解决方法中显示:
Windows Registry Editor Version 5.00 [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:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -Command \"$uri = [System.Uri]'%l';&\"${env:ProgramFiles}\\PuTTY\\putty.exe\" -P $uri.Port $uri.GetComponents([System.UriComponents]::UserInfo -bor [System.UriComponents]::Host,[System.UriFormat]::UriEscaped)\""
我现在可以从所有三个主要浏览器打开SSH和VNC链接.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。