This article explains how to import an SSH key via root access.
Importing an SSH key via root access allows for secure, password-less authentication when connecting to the server, enhancing both security and convenience.
Follow the systematic steps:
- Launch the PuTTY application on your computer.
- Configure the Connection:
- Under the Sessions menu, enter the IP address of the server.
- Ensure that the SSH button is selected.
- Click Open.
- Log in using the root password.
- Edit the Authorized Keys File:
- Run the following command to edit the authorized_keys file:
nano .ssh/authorized_keys
- Add your public key (the one with ssh-rsa in front) to the file on a single line.
- Run the following command to edit the authorized_keys file:
- Save Changes:
Press Ctrl+X, then Y to save the entry. - Restart the SSH Service:
Run the following command to restart the SSH service:service sshd restart
The SSH key would now be imported using root access. However, if you find any difficulty in this process, feel free to contact our experts, they are available for you 24×7.