[LINUX] Ssh to an external server under http proxy [from Ubuntu 18.04]

Introduction

I had a hard time when I wanted to ssh connect to an external server from the environment under the http proxy, so I will record it as a memorandum. Basically [here](https://kaworu.jpn.org/security/HTTP%E3%83%97%E3%83%AD%E3%82%AD%E3%82%B7%E3%82% B5% E3% 83% BC% E3% 83% 90% E7% B5% 8C% E7% 94% B1% E3% 81% AEssh% E6% 8E% A5% E7% B6% 9A) was used as a reference.

procedure

Installation

// sudo apt-Don't forget to get update
sudo apt-get install squid3
sudo apt-get install connect-proxy
sudo apt-get install openssh-client

squid settings

Add the following to /etc/squid3/squid.conf (it was squid in my environment (3 is not added)).

acl SSL_ports port 22
acl Safe_ports port 22          # ssh

Now restart squid.

//Again, I couldn't get 3 in my environment. If it has not started so far, start
service squid3 restart

ssh settings

Edit ~ / .ssh / config as follows. Please correspond the part of example.com.

Host example.com
        Hostname example.com
        ProxyCommand connect-proxy -H <http proxy url>:<http proxy port> %h %p

Run

Ssh as usual.

ssh [email protected]

that's all

Recommended Posts

Ssh to an external server under http proxy [from Ubuntu 18.04]
[Postgresql] SSH connection to the external DB server from the client
Try to create an HTTP server using Node.js
How to generate a public key from an SSH private key
Write an HTTP / 2 server in Python
From Ubuntu 20.04 introduction to environment construction
Ssh connect to GCP from Windows
Use the pip command under an HTTP proxy environment that requires authentication
Creating an Ubuntu 18.04 + MAAS2.4 environment starting from 0
python3 How to install an external module
Push notification from Python server to Android
SSH login to the target server from Windows with a click of a shortcut
Install and configure PyFilter client to monitor SSH connection to Alibaba Cloud Ubuntu server