I need to deploy a CentOs Cloud Image on private server(kind of bare metal server). So i download CentOS cloud image and customize it with virt-customize
having SSH enabled with Password Authentication by running build_script.sh
having following commands.
distro=$1
config_dir=$2
if [[ -z $distro ]]; then
echo "USAGE: $0 image_path config_dir"
exit 0
fi
if [[ -z $config_dir ]]; then
echo "USAGE: $0 image_path config_dir"
exit 0
fi
sudo virt-customize --install openssh-server -a $distro
sudo virt-customize --install openssh-clients -a $distro
sudo virt-customize --run-command 'systemctl enable sshd' -a $distro
sudo virt-customize --mkdir /var/ssh/ -a $distro
sudo virt-customize --copy-in $config_dir/sshd_config:/etc/ssh/ -a $distro
sudo virt-customize --run-command 'systemctl start sshd' -a $distro
And sshd_config
looks like
ClientAliveInterval 360
ClientAliveCountMax 0
PermitEmptyPasswords no
PermitRootLogin no
PasswordAuthentication yes
Before deploying and booting up i have manually verified that sshd_config
is having these values but, when it boots up the configuration change PasswordAuthenticatin yes
to PasswordAuthentication no
. What is changing this, i am not able to debug. Thanks in advance for Helping.