• 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


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



Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.