The Public key authorization

The first thing to do is to 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 walk through on the control node:

$ ssh-keygen -t rsa <<<< generates public-private key pair on the host machine
$ 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 control node to remote node without using the private key and without being prompted for a password.

Can you automate the initial public key copying? It is possible but is highly depended on your use case, regulation, and environment. It is comparable to the initial console setup for network gears to establish initial IP reachability. Do you automate this? Why or why not?
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.80.34