delinit_files/alpinit

26 lines
664 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.
#
###########################################################################
apk add openssh
apk add python3
ln -s /usr/bin/python3 /usr/bin/python
rc-update add sshd
echo "PermitRootLogin prohibit-password" >>/etc/ssh/sshd_config
service sshd restart
passwd -u root
mkdir /root/.ssh
chmod 700 /root/.ssh
curl http://delinit.lan/ssh-keys -o /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys