Users can add and remove their own Public SSH key(s) after they have initial access.

Open ~/.ssh/authorized_keys in your preferred text editor

[username@l001 ~]$ emacs  ~/.ssh/authorized_keys 
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhUvyVz/unSP5r5v5fxAw57opd4502rLcMvkhLmB36o [email protected]  

Each entry is a separate line, so you can add or remove access as needed.

Generating SSH Keys

Add a key

[eschneid@brain ~]$ cat ~/.ssh/id_ed25519.pub 
ssh-ed25519 BBBBBC3NzaC1lZDI1NTE5AAAAIPhasdfewerf03SP5r5v5fxAw57opd4502rLcMvkhLmB36o [email protected]

^ copy the line you want.
and paste as a new line to your authorized_keys file

[username@l001 ~]$ vim ~/.ssh/authorized_keys 
ssh-ed25519.....
ssh-rsa....
ssh-ed25519 BBBBBC3NzaC1lZDI1NTE5AAAAIPhasdfewerf03SP5r5v5fxAw57opd4502rLcMvkhLmB36o [email protected]

Test the connection
[eschneid@brain ~]$ ssh [email protected]
You shouldn't need to enter a password.

Remove a key

Find the key you want to remove and delete the line.
[username@l001 ~]$ vim ~/.ssh/authorized_keys
ssh-rsa...
ssh-ed25519 BBBBBC3NzaC1lZDI1NTE5AAAAIPhasdfewerf03SP5r5v5fxAw57opd4502rLcMvkhLmB36o [email protected]
  • No labels