#!/bin/bash mkdir -p /root/.ssh if [[ -n ${SSH_KEY} ]]; then echo ${SSH_KEY} > /root/.ssh/authorized_keys chmod 700 /root/.ssh chmod 600 /root/.ssh/* fi sed -i -e "s/#PasswordAuthentication yes/PasswordAuthentication no/" /etc/ssh/sshd_config ssh-keygen -A /usr/sbin/sshd -D