A quick way to add additional RSA public keys for authentication
in Linux
APPLIES TO:
Linux OS - Oracle Linux 7, Oracle Linux 8 and Oracle Linux 9.
Oracle Cloud Infrastructure and on premises.
Linux x86-64
GOAL:
Add additional RSA public keys for authentication.NOTE: It requires SSH access so if access has been lost, then this document is not for you.You will also need to have permissions on <user> home directory.
SOLUTION:
LINUX TO LINUX:
cat <pubkey> | ssh -i <priv key> <user>@<ip add> 'cat >> .ssh/authorized_keys'
WINDOWS to LINUX:
type <pubkey> | ssh -i <privkey> <user>@<ip> 'cat >> .ssh/authorized_keys'
Tagged:
0