This shows you the differences between two versions of the page.
|
rl:labs:07:contents:02 [2023/11/05 12:42] vlad_iulius.nastase |
rl:labs:07:contents:02 [2025/11/16 17:43] (current) laura.ruse |
||
|---|---|---|---|
| Line 17: | Line 17: | ||
| Aceștia sunt pașii pe care îi veți urma pentru a configura conectare SSH pe bază de chei: | Aceștia sunt pașii pe care îi veți urma pentru a configura conectare SSH pe bază de chei: | ||
| - generare pereche de chei SSH (folosind comanda ''ssh-keygen'') | - generare pereche de chei SSH (folosind comanda ''ssh-keygen'') | ||
| - | - copiere cheie publică în contul de la distanță (<del>folosind comanda ''ssh-copy-id''</del>) | + | - copiere cheie publică în contul de la distanță (în fișierul ''.ssh/authorized_keys'') |
| - conectare la distanță (folosind comanda ''ssh'') | - conectare la distanță (folosind comanda ''ssh'') | ||
| <note important> | <note important> | ||
| - | Autentificarea cu parolă a fost dezactivată pe ''student@host''! | + | De obicei cheia se copiază la distanță folosind ''ssh-copy-id'', dar în cazul nostru, pe ''student@host'' a fost dezactivată autentificarea cu parolă, deci nu va funcționa ''ssh-copy-id''. |
| - | Copiați manual cheia publică a corinei (''/home/corina/.ssh/id_rsa.pub'') în fișierul ''/home/student/.ssh/authorized_keys'' de pe host. | + | Prin urmare, va trebui să copiați manual cheia publică a corinei (''/home/corina/.ssh/id_rsa.pub'') în fișierul ''/home/student/.ssh/authorized_keys'' de pe host. |
| **Atenție:** nu ștergeți nimic din fișierul authorized_keys de pe host, altfel riscați să vă tăiați accesul la VM! | **Atenție:** nu ștergeți nimic din fișierul authorized_keys de pe host, altfel riscați să vă tăiați accesul la VM! | ||
| Line 31: | Line 31: | ||
| <solution> | <solution> | ||
| <code bash> | <code bash> | ||
| - | corina@blue:~$ ssh-copy-id student@host | + | corina@blue:~$ cat .ssh/id_rsa.pub |
| - | student@host's password: | + | (copy key) |
| - | Now try logging into the machine, with "ssh 'student@host'", and check in: | + | |
| - | ~/.ssh/authorized_keys | + | student@host:~$ vim .ssh/authorized_keys |
| - | + | (paste key) | |
| - | to make sure we haven't added extra keys that you weren't expecting. | + | |
| corina@blue:~$ ssh -l student host | corina@blue:~$ ssh -l student host | ||
| [...] | [...] | ||
| student@host:~$ | student@host:~$ | ||
| - | |||
| </code> | </code> | ||
| </solution> | </solution> | ||
| </hidden> | </hidden> | ||