LoginSignup
1
1

More than 5 years have passed since last update.

CONNECT対応のHTTP Proxyを踏み台にSSHに入るための.ssh/config

Posted at

これも完全に自分用のメモ。
(家のルータの設定をミスって、SSHのポートを塞いでしまった時にもがいたメモ)

connect-proxyをいれる

sudo apt-get install connect-proxy

.ssh/config

Host localhost
    Port 22
    ProxyCommand connect-proxy -H xxx.xxx.xxx.xxx:pppp %h 22

xxx.xxx.xxx.xxx:pppp ・・・HTTPプロキシ鯖

これで

yi01@asama:~$ ssh localhost
yi01@localhost's password: 

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have new mail.
Last login: Sat Apr  9 22:17:56 2016 from localhost
yi01@hayate:~$ 

のように、HTTP Proxyが立っている鯖にSSHで入れる。
通常、localhostにSSH接続することはまずないので、.ssh/configでつぶしちゃっても問題ないかなと。

というかそもそも

SSHのポートを開けておくのとHTTP Proxyのポートを開けておくのでは、前者のほうが安全なことが多いので、大抵の場合こんな技は使えないのだけども・・・。

1
1
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
1
1