This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# SSH启动脚本 - 确保密码和SSH服务正确配置
# 设置root密码
echo 'root:Aa@123456' | chpasswd
# 确保SSH目录存在
mkdir -p /var/run/sshd
# 如果SSH主机密钥不存在,生成它们
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
ssh-keygen -A
fi
# 启动SSH服务
echo "Starting SSH daemon..."
exec /usr/sbin/sshd -D