Macで ~/.ssh/config ファイルを使って複数ホストへのアクセス情報を管理する

vim ~/.ssh/config
--------------------
Host host1.hoge.com
  HostName host1.hoge.com
  Port 22
  User termuser
  IdentityFile /path/to/keys/host1-rsa.pem

Host host2.piyo.com
  HostName host2.piyo.com
  Port 22
  User termuser
  IdentityFile /path/to/keys/host2-rsa.pem
--------------------

sudo chown root: ~/.ssh/config
sudo chmod 0700 ~/.ssh/config

mkdir -p /path/to/keys
sudo chown -R root: /path/to/keys
sudo chmod -R 0700 /path/to/keys

vim ~/.bash_profile
--------------------
alias ssh="sudo ssh -F ~/.ssh/config"
--------------------

source ~/.bash_profile
ssh host2.piyo.com