非交互式修改SSH密码

方式1:

echo "password" | passwd testuser --stdin > /dev/null 2>&1

方式2:

echo testuser:password|chpasswd

在shell脚本和Dockerfile中请使用方式2