Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Adding a User's Public SSH Key to a Linux Server

RSS
Modified on Fri, Jun 04, 2021, 8:45 AM by Administrator Categorized as Linux

Overview

This article explains how to add the public key for a specific user to a Linux server. On a Windows machine, this key can be generated by following this procedure.

Procedure

1. Ensure the PUB file follows the naming convention "FirstName_LastName.pub"

2. Ensure the PUB file has a carriage return as its final character.

3. Upload the PUB file to the /home/ec2-user folder.

NOTE: This assumes the user will login as the ec2-user user. If they login as a different user, replace "ec2-user" with their username.

4. Open a PuTTY session to the server

5. Change to the current user's SSH folder

cd ~/.ssh

6. Backup the authorized_keys file

cp authorized_keys ak_yyyy-mm-dd

7. Append the user's public key to the authorized_keys file

cat ~/FirstName_LastName.pub >> authorized_keys

8. Verify that the key was appended.

cat authorized_keys

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.