0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

#docker で SOCKS proxy を利用して ssh サーバー経由の https 接続をする

0
Last updated at Posted at 2019-11-02

docker run

docker run --name=socks-https-proxy -it --rm alpine sh

必要なライブラリの install

/ # apk add --update openssh curl

必要があれば local から コンテナに秘密鍵をコピーしておく

docker cp ~/.ssh/some.pem socks-https-proxy:/

SOCKS で proxy を起動する

起動させっぱなしにしておく

ssh -vND 8888 -i some.pem user@host

docker exec

同じコンテナにコンソールの別タブからアクセスする

$ docker exec -it socks-https-proxy  ash

curl

httpbin.orgというサービスで接続元のIPアドレスを確認

/ # https_proxy=socks://127.0.0.1:8888 curl -v https://httpbin.org/ip

{
  "origin": "YYY.YYY.YYY.YYY, YYY.YYY.YYY.YYY"
}

ssh接続しているサーバーのIPアドレスになっていたら成功。

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?