Add a user to authorized_keys – Solved

Add a user to authorized_keys

Hey there folks, I ran into a task where I needed to add a user to one the machiens so she could SSH into the machine without being prompted to enter the password.

Assumptions are:
1. You already have root privilages

2. .ssh key directory in /root is created and authorized_keys already exists

Here are the simple steps:

  1. Navigate to /root/.ssh
  2. use the vi editor to open the file like so: vi authorized_keys
  3. Page all the way down and append your public key at the end of the file

You can access it via ssh client, just pull the authorized_keys down to your machine and edit it. After which you’d need to cpy over the file back on to the machine, and BAM. That’s all it it.


Leave a Reply