The public key authorization

The first thing to do is copy your SSH public key from your control machine to the target machine. A full public key infrastructure tutorial is outside the scope of this book, but here is a quick walkthrough on the control node:

$ ssh-keygen -t rsa <<<< generates public-private key pair on the host machine if you have not done so already$ cat ~/.ssh/id_rsa.pub <<<< copy the content of the output and paste it to the ~/.ssh/authorized_keys file on the target host

Because we are using key-based authentication, we can turn off password-based authentication on the remote node and be more secure. You will now be able to ssh from ...

Get Mastering Python Networking - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.