Okay, final task, manage SSH access.
Set up SSH passphrase-based authentication which allows the root user to log in from
server 1 to server 2 without having to enter anything.
Let me show you.
So still on server 1, I'm going to use SSH keygen because that is what we need.
This user root, it's going to create a public-private key pair.
And when you press enter, enter, enter, then you have a password-less public-private key
pair.
And I'm using SSH copy ID to server 2 to get it there.
So we need to answer yes because I want to continue connecting.
And I need to enter the root user password and, oh, that's a little issue.
We have a problem with the root user password, and I will show you why.
I'm going to use SSH Anna at server 2.
User Anna should be allowed.
And now I'm going to use sudo vim etc ssh sshd-config where we can see this permit root
login line.
And that is currently set to prohibit password.
Well, in the end, that might be what we want.
But for now, permit root login, we need to set it to yes because how are we otherwise
going to be able to copy over the public-private key pair?
So next, sudo systemctl restart sshd so that SSHD can pick it up back to server 1, and
we try it again.
And now SSH server 2 is working smoothly, and we don't have to enter a password at all.
And that is what we had in mind here.
So this brings us to the end of this sample exam.
Don't forget to run the exam grade script from the course Git repository to grade your
work and check how well you've done.