ServerAuditor is a free iPad app that allows ssh to a server. I am trying to copy my public key to a server to allow password less login. On a pc this is easy- Generate the rsa key open terminal and
a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password:
Enter the password and I'm good.
This app however has the following script where $1 is .ssh and $2 is authorized keys and $3 is the public key
if test ! -e $1;
then mkdir $1;
chmod 700 $1;
fi;
if test ! -e $1/$2;
then touch $1/$2;
chmod 600 $1/$2;
fi;
echo $3 >> $1/$2
I think I know what the bash script is doing but why does it change the permissions?