Ssh to amazon EC2 through proxy

I have some problem related to my Amazon EC2 server via ssh over proxy.

I have a username and password for the 8080 proxy port. (Do not control the proxy server) I also have a connection string that will work without the ssh -i proxy server key.pem root@xx.compute.amazonaws. com

1) when I try to connect, I get an error "No route to the host" 2) I tried to use putty, configured proxy + authentication file, but then I get this error "Unable to use this key file (OpenSSH SSH-2 private key) "Also, I don’t know how putty inserts my proxy configuration into the ssh connection string, so I can try it in the terminal

Any help would be appreciated!

SOLUTION:
Here is a tutorial that works great: http://www.mtu.net/~engstrom/ssh-proxy.php
Note: you will need to install a corkscrew.
Also this configuration allows rsync to be launched through a proxy server
Example:rsync -avz -e "ssh -i key.pem" ec2-user@xx.compute.amazonaws.com:/amz /home

+3
source share
2 answers

I ran into the same problem and this is what I used to connect using a corkscrew. My configuration file is as follows:

Host AWS
    Hostname <Public DNS>
    Port 443
    #Write the appropriate username depending on your AMI, eg : ubuntu, ec2-user
    User ubuntu
    IdentityFile </path to key file>
    ProxyCommand /usr/bin/corkscrew 10.10.78.61 3128 %h %p

then I just use this command to connect

ssh AWS

and it works flawlessly.

Note . You must edit the sshd_config file on the server to listen for ssh connections on port 443 (in addition to 22) and restart the ssh daemon. P>

+2
source

, root? ec2-user.

, IP , DNS, , . aws . , DNS , xx.compute.amazonaws.com addr.

+1

Source: https://habr.com/ru/post/1795264/


All Articles