portable-mc-server/ssh/run.sh
2024-01-30 20:39:50 +03:00

10 lines
No EOL
289 B
Bash

if [[ -z "$SSH_PASSWORD" ]]; then
export SSH_PASSWORD=admin
fi
mkdir /var/run/sshd
echo "root:$SSH_PASSWORD" | chpasswd
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
exec /usr/sbin/sshd -D