以下の内容はhttps://takuya-1st.hatenablog.jp/entry/20110628/1309230095より取得しました。


SSHホスト毎に別のユーザー名と鍵を使う

SSHを頻繁に使っていると,id_rsa 一個じゃ全然足りない。コマンド毎に鍵を指定してオクのめんどくさい。


SSHのログイン鍵とログインユーザーをサーバー毎に別にする

.ssh/config

Host 192.168.10.*
	IdentityFile ~/.ssh/id_rsa-local
	
Host 192.168.21.*
        user admin
	IdentityFile ~/.ssh/id_rsa-local21

これで設定終わりです。わかりやすいですね。

ssh 192.168.10.12
ssh 192.168.21.12

で別々の鍵が使われます。

別の方法

コマンドのAliasを登録する

alias ssh_hogege='ssh hogehoge -i .ssh/id_rsa-local21'
alias ssh_fuba='ssh fuba@hogehoge -i .ssh/id_rsa-local21'

alias 使うのも楽で良いですね。




以上の内容はhttps://takuya-1st.hatenablog.jp/entry/20110628/1309230095より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14