Junior — Middle
Каким образом можно создать SSH-ключ в операционной системе Linux?
sobes.tech AI
Answer from AI
To create an SSH key in Linux, the command ssh-keygen is used. It generates a pair of keys: private and public.
Example of creating an RSA key with a length of 4096 bits:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Explanations:
-t rsa— key type (RSA).-b 4096— key length in bits.-C— comment, usually an email for identification.
After running, the command will ask where to save the key (default ~/.ssh/id_rsa) and optionally a password to protect the private key.
Result:
- Private key:
~/.ssh/id_rsa - Public key:
~/.ssh/id_rsa.pub
The public key can be added to the server for passwordless authentication.