Skip to content

Instantly share code, notes, and snippets.

@5470x3
Created July 4, 2015 21:33
Show Gist options
  • Save 5470x3/766f83204db96f6d5db8 to your computer and use it in GitHub Desktop.
Save 5470x3/766f83204db96f6d5db8 to your computer and use it in GitHub Desktop.
.ssh/configからホスト名を引いてきてsshに渡すだけのoneliner
grep "Host " ~/.ssh/config | while read f; do ssh -nv $f ;done < <(awk '{print $2}')
# sshは-nオプションを渡さないと標準出力がリモートホストのものに変わってしまう
# もともとは鍵があっているかどうか確認するためのスクリプトだった
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment