for file in `find ~/.ssh -type f `; do ls --time-style=long-iso -faZl $file | awk '{
k = 0
s = 0
for( i = 0; i <= 8; i++ )
{
k += ( ( substr( $1, i+2, 1 ) ~ /[rwxst]/ ) * 2 ^( 8 - i ) )
}
j = 4
for( i = 4; i <= 10; i += 3 )
{
s += ( ( substr( $1, i, 1 ) ~ /[stST]/ ) * j )
j/=2
}
if ( k )
{
printf( "%0o%0o ", s, k )
}
print
}' | sort -n | perl -ne 's/\s+/ /g;@token=split(" ",$_);print "chmod $token[3]:$token[4] $token[9] \n";print "chmod " . "$token[0]" . " $token[9]" . "\n";' ; done ;
#chmod username:None /home/username/.ssh/id_rsa
#chmod 0600 /home/username/.ssh/id_rsa
#chmod username:None /home/username/.ssh/id_rsa.pub
#chmod 0644 /home/username/.ssh/id_rsa.pub
#chmod username:None /home/username/.ssh/known_hosts
#chmod 0644 /home/username/.ssh/known_hosts
pre class=