ssh-keygen -t rsa
This will geenerate ~/..sh/id_rsa.pub
Copy ~/.ssh/id_rsa.pub to target machine e.g. /tmp/tmpkey
As target user run:
cat /tmp/tmpkey >> ~/.ssh/authorized_keys
Ensure correct permissions
chmod go-w $HOME $HOME/.ssh $HOME/.ssh/authorized_keys