dotfiles/crates/01-ssh/crate.sh
2023-10-14 22:38:14 +02:00

17 lines
No EOL
487 B
Bash

#!/bin/sh
describe="setup ssh"
apply() {
[ -e "$HOME/.ssh/authorized_keys" ] || ln files/authorized_keys $HOME/.ssh/authorized_keys
if ! [ -f "$HOME/.ssh/id_rsa" ]; then
echo "Creating new ssh key for this device..."
ssh-keygen -f $HOME/.ssh/id_rsa -p "" -q
echo "Adding key to authorized_keys..."
cat $HOME/.ssh/id_rsa.pub > $HOME/.ssh/authorized_keys
fi
}
undo() {
echo "Undoing ssh keys is not supported, please do this manually."
}