SSH Proxy Command -- connect.c

ネタ元:odz buffer - SSHで多段ログインする方法(別解)

Features of connect.c are:

  • Supports SOCKS (version 4/4a/5) and https CONNECT method.
  • Supports NO-AUTH and USERPASS authentication of SOCKS
  • Partially supports telnet proxy (experimental).
  • You can input password from tty, ssh-askpass or environment variable.
  • Run on UNIX or Windows platform.
  • You can compile with various C compiler (cc, gcc, Visual C, Borland C. etc.)
  • Simple and general program independent from OpenSSH.
  • You can also relay local socket stream instead of standard I/O.

~/.ssh/configにこんなん

Host           internal_host
  ProxyCommand ssh gw_host connect %h %p

で、gw_host経由でinternal_hostにsshできる。port forwardのsshを走らせる手間が省ける。

rsync + cron + ssh (rsyncd を立てない編)

このテキストでは、 rsync を使ったリモートバックアップ(遠隔バックアップ)の方法、特に ssh と cron を利用して、暗号化された経路を経由してのバックアップを自動的に行うための手順を示します。

ここで ssh の認証には、パスフレーズを空にし、かつ実行できるコマンドを限定した ssh 鍵ペアを作成し使用します。これにより、 ssh-agent や eychain を利用する方法、ホストベース認証を利用する方法よりも安全なバックアップ体制が整えられる……はずです。