fix ssh keygen in nixos-edit init

This commit is contained in:
Daniella / Tove 2024-10-19 03:13:34 +02:00
parent 12bffa270e
commit 71a1e341f5

View file

@ -24,15 +24,15 @@ pkgs.writeShellScriptBin "nixos-edit" ''
echo dir setup done
echo "> setting up ssh"
echo ssh setup
if ! [ -e ~/.ssh/id_rsa ] ; then
if ! [ -e ~/.ssh/id_* ] ; then
ssh-keygen || exit
fi
echo ssh key created
cat ~/.ssh/id_rsa.pub | xclip -selection clipboard
cat ~/.ssh/id_*.pub | xclip -selection clipboard
echo "-> copied to clipboard for later"
echo adding it to syncfs
echo "-> you will need to input your password"
ssh root@tudbut.de ssh -p 23 localhost bash -c "echo -e '# $(cat /etc/hostname)\n$(cat ~/.ssh/id_rsa.pub)\n' >> .ssh/authorized_keys" || exit 1
ssh root@tudbut.de ssh -p 23 localhost bash -c "echo -e '# $(cat /etc/hostname)\n$(cat ~/.ssh/id_*.pub)\n' >> .ssh/authorized_keys" || exit 1
echo "> ssh setup done"
echo "> setting up git"
git config --global user.name "TudbuT"