Generate keypair
ssh-keygen -t ed25519 -f ~/.ssh/<output_file>
ssh-copy-id -i ~/.ssh/<output_file>.pub user@ip
OR
cat ~/.ssh/<output_file>.pub | ssh user@ip 'cat >> ~/.ssh/authorized_keys'
ssh-keygen -t ed25519 -f ~/.ssh/<output_file>
ssh-copy-id -i ~/.ssh/<output_file>.pub user@ip
OR
cat ~/.ssh/<output_file>.pub | ssh user@ip 'cat >> ~/.ssh/authorized_keys'