• Compute
    Compute

    Configure a popular Linux OS or use popular developer Tools

  • Cloud hosting
    Cloud hosting

    Host a VPS in the Cloud in seconds

  • Collaborate, CMS, CRM`s
    Collaborate, CMS, CRM`s

    Collaborate with these popular CMS, CRM & collaboration tools

  • Database & E-Commerce
    Database & E-Commerce

    Create a database or an E-Commerce environment in seconds

[Basic] How to: Add an existing Private SSH Key to New Users on Linux

Modified on Fri, Feb 21, 2020 at 1:06 AM


HOW TO ADD AN EXISTING PRIVATE SSH KEY TO USERS ON LINUX


When trying to use a private key as a new user, you must first create a .ssh directory for that new user, followed by creating an authorized_keys file inside of that .ssh directory for the user. Then, copy the key stored inside the authorized_keys file inside the .ssh directory under the /root directory.

Inside of the new user’s /home directory, create a directory called ‘.ssh’ by typing:


Mkdir .ssh


(The .ssh folder will be a hidden folder, and can only be seen by running ‘ls -a’)

Inside the .ssh directory run by typing:


touch authorized_keys


From your /root directory, run the following command:


cat /.ssh/authorized_keys >> /home/username/.ssh/authorized_keys


This will append what you have in /root’s authorized_keys file to the specified user’s authorized_keys file, allowing your new user access via private SSH.


READ: How to Create New Users and Grant Sudo Privileges to Users on Linux



Join our Private Discord Chat to chat with, as well as find community assistance from other Verified SkySilk Users: https://invite.gg/SkySilk 


CLICK TO DEPLOY AN UBUNTU LINUX VPS



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article