Last active
September 23, 2018 16:50
-
-
Save simbalinux/a64e13d46deb69887f478f018cd2262c to your computer and use it in GitHub Desktop.
Verify ssh keys exist || create new ones without password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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