delinit_files/debinit

21 lines
611 B
Bash
Executable File

#!/bin/bash
###########################################################################
#
# Simple script to install openssh server and setup the root user for
# remote ssh access from my account. This enables the target host for
# ansible management.
#
###########################################################################
apt -y install openssh-server
apt -y install python3
echo "PermitRootLogin prohibit-password" >>/etc/ssh/sshd_config
systemctl restart ssh
mkdir /root/.ssh
chmod 700 /root/.ssh
curl http://delinit.lan/ssh-keys -o /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys