portable-mc-server/ssh/run.sh

10 lines
289 B
Bash
Raw Permalink Normal View History

2024-01-30 20:39:50 +03:00
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