Skip to main content
Redirect doesn't seem to be needed.
Source Link
paradroid
  • 1.3k
  • 2
  • 19
  • 39

This uses regex to match all files beginning with id_ and not ending with and dot-suffix, like .pub.

find ~/.ssh -type f -regextype egrep -regex '.*/id_[^.]+$' | xargs ssh-add &> /dev/null 

The problem with using a for loop, like in the accepted answer, is that you will keep on needing to enter the passphrase even when the same one is used for all keys.

This uses regex to match all files beginning with id_ and not ending with and dot-suffix, like .pub.

find ~/.ssh -type f -regextype egrep -regex '.*/id_[^.]+$' | xargs ssh-add &> /dev/null 

The problem with using a for loop, like in the accepted answer, is that you will keep on needing to enter the passphrase even when the same one is used for all keys.

This uses regex to match all files beginning with id_ and not ending with and dot-suffix, like .pub.

find ~/.ssh -type f -regextype egrep -regex '.*/id_[^.]+$' | xargs ssh-add 

The problem with using a for loop, like in the accepted answer, is that you will keep on needing to enter the passphrase even when the same one is used for all keys.

Source Link
paradroid
  • 1.3k
  • 2
  • 19
  • 39

This uses regex to match all files beginning with id_ and not ending with and dot-suffix, like .pub.

find ~/.ssh -type f -regextype egrep -regex '.*/id_[^.]+$' | xargs ssh-add &> /dev/null 

The problem with using a for loop, like in the accepted answer, is that you will keep on needing to enter the passphrase even when the same one is used for all keys.