Add quick SSH setup script

This commit is contained in:
Anthony Rose 2025-03-23 21:41:36 +00:00
parent c315554306
commit 6bb375e6f2

19
setup.sh Normal file
View file

@ -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