These steps will let the user that you create ssh to a running instance using a password you set. The user can reset the password once they login and/or add their ssh keys.
All steps to be run as root or using sudo.
- Run 'adduser username'
- Run 'passwd username' and assign a temporary password
- Run 'usermod -a -G users username'
If you have the user's public SSH key, do the following:
Run 'mkdir ~username/.ssh/'
- Run 'chmod 700 ~username/.ssh/'
- Run 'chown username:username ~username/.ssh/'
- Copy the user's public ssh into ~username/.ssh/ or use an editor to create the file authorized_keys in that directory and paste the contents of their public SSH into that file
- Run 'chown username:username ~username/.ssh/authorized_keys'
If you do not have the user's public SSH key, you will also need to do these steps. It is best, from a security standpoint, to ONLY allow public key access.
- Edit /etc/ssh/sshd_config and add the line PasswordAuthentication yes and then save the file
- Restart sshd ('service sshd restart' for CentOS 6, 'service ssh restart' for Ubuntu 14.04 systems, -OR- 'systemctl sshd restart' for CentOS 7)