grozail / ssh-pub-keys

This repo countains ssh public keys, also scripts for importing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repo countains ssh public keys. Add you public ssh keys *.pub into root folder and run add_auth_keys.sh on remote server.

Install requirements

sudo apt-get install wget unzip

or use other package manager to install wget && unzip

How to update keys with one-liner

wget https://raw.githubusercontent.com/minsk-hackerspace/ssh-pub-keys/master/update_authorized_keys.sh -q -O - | sh

Short form:

wget goo.gl/jGyzbk -O - | sh

How to install an update as a cron job

Run this from command line under specific user

{ crontab -l; echo '*/10 * * * * wget https://raw.githubusercontent.com/minsk-hackerspace/ssh-pub-keys/master/update_authorized_keys.sh -q -O - | sh'; } | crontab -

This cron job will update keys every 10 minutes

Beware, update script makes authorized_keys backup. It is your responsibility to delete old backups!

How to clean up old backups

find ~/.ssh -name "*authorized_keys_*" -mindepth 1 -mtime +5 -delete
find ~/.ssh/keys_backup -name "*authorized_keys_*" -mindepth 1 -mtime +5 -delete

Deletes backups older than 5 days

About

This repo countains ssh public keys, also scripts for importing


Languages

Language:Shell 100.0%