Quickly add your github keys as authorized to your virtual server

Batch

USERNAME=yourgithubusernamemkdir -p ~/.sshif ! [[ -f ~/.ssh/authorized_keys ]]; then
echo "Creating new ~/.ssh/authorized_keys"
touch ~/.ssh/authorized_keys
fi
keys=`curl https://api.github.com/users/$USERNAME/keys | grep -o -E "ssh-\w+\s+[^\"]+"`for key in $keys; do
echo $key
grep -q "$key" ~/.ssh/authorized_keys || echo "$key" >> ~/.ssh/authorized_keys
done

Usage

curl -L http://bit.ly/easytoremembershortcut | bash -s

--

--

--

Software engineer, with project management background. Founder @ softasap.com — cool automation for the people :) — have a problem that needs to be solved?

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vyacheslav Voronenko

Vyacheslav Voronenko

Software engineer, with project management background. Founder @ softasap.com — cool automation for the people :) — have a problem that needs to be solved?

More from Medium

Simple Counter Widget with KivyMD

How to get and set a GitHub access token

Remote MySQL Database setup for Magento2 domain

Build own free file hosting with nextcloud in cloud server from Alibaba Cloud