System Administration

By duartecancela, 5 April, 2023

To access a Linux server with SSH and configure key pairs, follow these steps:

Generate a new key pair on your local machine (if you don't already have one) using the ssh-keygen command. This will create two files: a private key (usually stored in ~/.ssh/id_rsa) and a public key (stored in ~/.ssh/id_rsa.pub).

Copy the public key to the server using the ssh-copy-id command. This will add your public key to the authorized_keys file on the server, allowing you to authenticate using your private key.

ssh-copy-id user@server_address