In this recipe, you will see how to set up secure public key authentication.
You might need root privileges for certain tasks.
Follow these steps to set up public key authentication:
$sudo adduser john
johnand change to the
.sshdirectory if it doesn't already exist:
$ mkdir .ssh
$ touch .ssh/authorized_keys
$chmod 700 .ssh
$ chmod 600 .ssh/authorized_keys