Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
Doel
Set up key-based login so that student on server1 can log in to server2 without a password, and run commands there.
Voordat je begint
- Both machines run and can reach each other by name (see lab 8.1, or use the IP addresses).
- The user
studentexists on both machines with a password.
Taken
Vink een taak aan als hij klaar is. Alleen je browser onthoudt dit.
- On server1, as
student, make an Ed25519 key pair. Use an empty passphrase for this lab. - Copy the public key to
studenton server2. - Log in to server2 without a password and show the hostname.
- From server1, run the command
uptimeon server2 without opening an interactive shell. - Check that the permissions of
~/.sshand~/.ssh/authorized_keyson server2 are correct.
Controleer je werk
Hints
Toon de hints
ssh-keygen -t ed25519and press Enter for an empty passphrase.ssh-copy-idasks for the password one last time.
Oplossing
Toon de oplossing
- Make the key.
ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519 - Copy the public key.
ssh-copy-id student@server2 - Log in and check.
- Run one remote command.
ssh student@server2 uptime - Check and, if needed, fix the permissions on server2.
ssh student@server2 'chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys'
Mijn notities
Nog geen notities.