Skip to content

Instantly share code, notes, and snippets.

@simbalinux

simbalinux/check_keys

Last active Sep 23, 2018
Embed
What would you like to do?
Verify ssh keys exist || create new ones without password
#!/usr/bin/env bash
# check if ssh keys exist else create keys with no password automatically no prompting, ideal for shell scripts and automation
if [ -f $HOME/.ssh/id_rsa ]; then
echo rsa key installed
else
ssh-keygen -f /root/.ssh/id_rsa -t rsa -N ''
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment