Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过防火墙在windows上实现ssh(不是putty)_Ssh_Openssh - Fatal编程技术网

通过防火墙在windows上实现ssh(不是putty)

通过防火墙在windows上实现ssh(不是putty),ssh,openssh,Ssh,Openssh,我需要通过公司代理从我的Win10机器连接到Ubuntu SSH主机(12.34.56.78在另一个端口=443)。这必须通过命令行完成,所以我可以使用VS代码内部人员的“删除SSH”功能 我在win10客户端上创建了一个ssh密钥,并将pub密钥添加到授权的_密钥中,但它不起作用: PS C:\> ssh linuxuser@12.34.56.78 -p443 -o "ProxyCommand ssh.exe -p443 -X connect -x http://corporate-p

我需要通过公司代理从我的Win10机器连接到Ubuntu SSH主机(12.34.56.78在另一个端口=443)。这必须通过命令行完成,所以我可以使用VS代码内部人员的“删除SSH”功能

我在win10客户端上创建了一个ssh密钥,并将pub密钥添加到授权的_密钥中,但它不起作用:

PS C:\> ssh linuxuser@12.34.56.78 -p443  -o "ProxyCommand ssh.exe -p443 -X connect -x http://corporate-proxy:8080 %h %p" -v -o "IdentityFile C:\Users\win10user\.ssh\id_rsa"
OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4
debug1: Reading configuration data C:\\Users\\win10user/.ssh/config
debug1: C:\\Users\\win10user/.ssh/config line 1: Applying options for 12.34.56.78
debug1: Executing proxy command: exec ssh.exe -p443 -X connect -x http://corporate-proxy:8080 12.34.56.78 443
debug1: identity file C:\\Users\\win10user\\.ssh\\id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\win10user\\.ssh\\id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.6
ssh_exchange_identification: Connection closed by remote host
ssh_exchange_identification: Connection closed by remote host
我错过了什么

编辑:设置的路径/文件夹包含以下文件: 我还通过
openssl rsa-in~/.ssh/id\u rsa-outform pem>id\u rsa-cert生成了id\u rsa-cert

PS M:\> ls  C:\\Users\\win10user\\.ssh\


    Directory: C:\Users\win10user\.ssh


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       10/29/2019  10:18 AM            167 config
-a----       10/29/2019  10:07 AM           1766 id_rsa
-a----       10/29/2019  10:07 AM            415 id_rsa.pub
-a----       10/29/2019  11:02 AM           1675 id_rsa-cert


我找到了解决办法:

ProxyCommand C:\Users\win10suer\Nmap\ncat.exe --proxy proxy:8080 %h %p
也许问题出在:

debug1: key_load_public: No such file or directory

尝试将密钥放入所需目录

忘记提及:此文件夹中有一个密钥,这就是我明确设置路径以确保的原因PS C:\>ls C:\\Users\\win10user\.ssh\config id\u rsa id\u rsa.pub``另一个想法是,检查服务器上的~/.ssh/known\u主机。可能没有您的客户端ip?~/.ssh/known_主机不存在,因此我假设我的命令甚至没有到达我的主机。另外,“sudotail-f/var/log/auth.log”在尝试连接时不会显示新行。可能您的代理正在本地搜索密钥?(我的意思是在代理服务器上)我认为问题不在于密钥,而在于proxycommand本身(它从未到达主机)。该命令是否正确地通过http发送到fo-proxy@8080嘘-host@443?