#!/usr/bin/bash #find pubkey and set file.key permissions find $HOME/.ssh -name '*.pub' -print0 | while IFS= read -r -d '' line; do chmod 600 $HOME/.$(echo $line | cut -f 2 -d ".") || true; done