install.fairie/home/private_dot_ssh/run_onchanges_after_ensure-private-key.tmpl

12 lines
380 B
Cheetah
Raw Normal View History

#!/usr/bin/env bash
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
### Ensure id_rsa is present and create one if it does not exist
if [ ! -f "$HOME/.ssh/id_rsa" ]; then
logg 'Generating missing default private key / public key (`~/.ssh/id_rsa`)'
ssh-keygen -b 4096 -t rsa -f "$HOME/.ssh/id_rsa" -q -N ""
2023-03-20 02:32:51 -07:00
chmod 600 "$HOME/.ssh/id_rsa"
fi