Translate

2016/02/01

SSHの設定ファイル

SSHの接続をするのに、設定ファイルを作っておくと、便利。

https://dogmap.jp/2011/10/27/ssh_config/

~/.ssh/config を作って、

1
2
3
4
5
Host example
  HostName     example.com
  Port         10022
  User         wokamoto
  IdentityFile ~/.ssh/id_rsa.example

のようにする。

Proxyを使う場合は、

こんな感じ。

Host proxy
HostName 0.0.0.0
User fugafuga
IdentityFile ~/.ssh/keys/git_id_rsa

Host test.kayac
User fugafuga
Hostname test.site
IdentitiesOnly yes
IdentityFile ~/.ssh/keys/git_id_rsa
ProxyCommand ssh -W %h:%p proxy


その他、応用。

http://qiita.com/ik-fib/items/12e4fab4478e360a82a1

0 件のコメント:

コメントを投稿