Creating SSH keys
Yes.
Please create your key on the source system (ssh-keygen -t rsa
, for instance), then use the ssh-copy-id
command to push it to the remote system.
The following should work for you:
ssh-copy-id that_user@remote_server
Yes, just run ssh-keygen -t rsa
under each user, and then add the contents of ~/.ssh/id_rsa.pub
file, or whatever file you chose to contain created ssh key, to the end of ~/.ssh/authorized_keys
file in the home directory of the user on the remote server.
Yes, it's possible, have a look at this question: SSH public key authentication - can one public key be used for multiple users?
Basically you have to
- Create a private/public key pair for each user at local_machine, let's say id_rsa and id_rsa_.pub ; the keys will reside in each users' ~/.ssh/ folder.
- append the contents of each user id_rsa.pub into ~/.ssh/authorized_keys on remote-machine. You can do that remotely via
cat /home/newuser/.ssh/id_rsa.pub | ssh user@remote_machine "cat >> ~/.ssh/authorized_keys"