#!/bin/bash ( echo "qwe123" echo "qwe123" ) | passwd --stdin root sed -i "s/^PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config sed -i "s/^#PermitRootLogin yes/PermitRootLogin yes/g" /etc/ssh/sshd_config service sshd restart