-1

I need to connect to an Ubuntu SSH Host (12.34.56.78 on a different Port = 443) via a corporate proxy from my Win10 machine. This has to be done via commandline, so I can use VS Code Insiders "Remove SSH" function.

I created a ssh-key on the win10-client and added the pub-key to the authorized_keys, but it is not working:

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

What am I missing?

Edit: The set path/folder has the files: I also generated the id_rsa-cert via openssl rsa -in ~/.ssh/id_rsa -outform pem > id_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


I found the solution:

ProxyCommand C:\Users\win10suer\Nmap\ncat.exe --proxy proxy:8080 %h %p
thetemplar
  • 97
  • 2
  • 3
  • 9

1 Answers1

0

Maybe problem is in:

debug1: key_load_public: No such file or directory

Try to put key in needed directory

  • Forgot to mention: There IS a key in this folder, this is the reason I explicit set the path to be sure. ``` PS C:\> ls C:\\Users\\win10user\\.ssh\ config id_rsa id_rsa.pub ``` – thetemplar Oct 29 '19 at 09:51
  • 1
    Another idea, check ~/.ssh/known_hosts on server. Maybe there is no your client ip? – Gennady Morozov Oct 29 '19 at 10:01
  • ~/.ssh/known_hosts does not exist, therefore I assume my command does not even reach my host. Also "sudo tail -f /var/log/auth.log" shows no new lines when trying to connect. – thetemplar Oct 29 '19 at 10:14
  • Maybe your proxy is searching key locally? (i mean on proxy server) – Gennady Morozov Oct 29 '19 at 12:57
  • I think the problem is not the key, but the proxycommand itself (it never reaches the host). Is the command correct to fo through a http-proxy@8080 to a ssh-host@443? – thetemplar Oct 30 '19 at 08:52