Merge pull request #1400 from arunvelsriram/ssh-add-all

Add helper function to add all ssh private keys to agent
pull/1408/head
Nils Winkler 2019-07-29 08:54:04 +02:00 committed by GitHub
commit ca2e3edb97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -17,3 +17,10 @@ function sshlist() {
awk '$1 ~ /Host$/ {for (i=2; i<=NF; i++) print $i}' ~/.ssh/config awk '$1 ~ /Host$/ {for (i=2; i<=NF; i++) print $i}' ~/.ssh/config
} }
function ssh-add-all() {
about 'add all ssh private keys to agent'
group 'ssh'
grep -slR "PRIVATE" ~/.ssh | xargs ssh-add
}