Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 1.27 KB

rsa_ssh_key_setup.md

File metadata and controls

56 lines (38 loc) · 1.27 KB

RSA Key Setup

This describes the process of setting up a new user on a server with an RSA key. The user is able to control docker, and can log in to the server without a password. This enables us to use GitHub Actions to deploy our docker images to the server using SSH.

Help Links

Server actions

ssh root@server.alifeee.co.uk

Make new user

sudo useradd --create-home --user-group --shell /bin/bash --groups docker deploy
sudo usermod --lock deploy

Switch to new user

sudo -i -u deploy

Make an ssh key

$ ssh-keygen -f ~/.ssh/id_ed25519 -C "deploy@server"
> [no password]

Gopy key to authorised keys

cat .ssh/id_ed25519.pub > .ssh/authorized_keys

Client actions

Get ssh private key

scp root@server.alifeee.co.uk:/home/deploy/.ssh/id_ed25519 C:\Users\alifeee\.ssh

login with key (password not required)

ssh -i C:\Users\alifeee\.ssh\id_ed25519 deploy@server.alifeee.co.uk