Add quick SSH setup script
This commit is contained in:
parent
c315554306
commit
6bb375e6f2
1 changed files with 19 additions and 0 deletions
19
setup.sh
Normal file
19
setup.sh
Normal 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
|
Loading…
Add table
Reference in a new issue