From bf6f76c2152ef1e59ecc410a8140330094b33adb Mon Sep 17 00:00:00 2001 From: Raine Date: Sat, 14 Oct 2023 22:38:14 +0200 Subject: [PATCH] add: ssh authorized_keys --- crates/01-ssh/crate.sh | 17 +++++++++++++++++ crates/01-ssh/files/authorized_keys | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 crates/01-ssh/crate.sh create mode 100644 crates/01-ssh/files/authorized_keys diff --git a/crates/01-ssh/crate.sh b/crates/01-ssh/crate.sh new file mode 100644 index 0000000..2c187de --- /dev/null +++ b/crates/01-ssh/crate.sh @@ -0,0 +1,17 @@ +#!/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." +} \ No newline at end of file diff --git a/crates/01-ssh/files/authorized_keys b/crates/01-ssh/files/authorized_keys new file mode 100644 index 0000000..abd2989 --- /dev/null +++ b/crates/01-ssh/files/authorized_keys @@ -0,0 +1,2 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCeNQfnbyyF3sht43vH5BcXDPca8nWu6bKPVGvAlWBOq4Av8ME2IQgwVe9nJ05r73ZY02/Vdqc01a8wyK5Hmw0XlPL0Cn6wc9QoiscOvq5lMUK87S2tr3EVLGkgl8o7nmVuWgLewyojiORjM02P1PZEiFhKPXVEQFxU0dFz9QtpAdm0u78Xn2HTukHpXSv44R3XDDMFZ3Ek/XRuS6J9dZVxGkgCLQhK8kpfbxuiYxaRC7MHgGlYuxjLuZ6P4i+V+SSSShfCGdm6U9bgeIAwftN6a8Pc9+OsBeZGSUrGjZjRlD35q0a7fbpoS8pKTfbwgf/ijYeu3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