diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..585e282 --- /dev/null +++ b/setup.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -e +ssh_key='ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKG63aHe1QmTPj4mWg0F/fAzcB78tBJglxyLI0AzOKvW acp-home' +eval $(grep '^ID=' /etc/os-release) +distro=${ID:-unknown} +case $distro in + debian) + apt update + apt install openssh-server + install -d -m 0700 $HOME/.ssh + echo $ssh_key > $HOME/.ssh/authorized_keys + echo 'PermitRootLogin prohibit-password' > /etc/ssh/sshd_config.d/root.conf + systemctl restart ssh.service + ;; + *) + echo "Unknown distro" >&2 + exit 1 + ;; +esac