RHEL8: Generate SSH Key to user
Generate key using Puttygen with Ed25519 key type

Copy public key to row below and change USERNAME to user the key will apply to.
sudo -u USERNAME -i -- sh -c 'mkdir -p ~/.ssh && chmod 700 ~/.ssh && touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys && echo "PUBLICKEYSTRING" >> ~/.ssh/authorized_keys'
Leave a Reply