Created
February 9, 2025 02:21
-
-
Save mrnim94/dec1d8a1785c4fc9ef0f56428044203b to your computer and use it in GitHub Desktop.
change Pass root
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Enable ssh password authentication | |
echo "Enable ssh password authentication" | |
sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config | |
sed -i 's/.*PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config | |
systemctl restart ssh | |
# Set Root password | |
echo "Set root password" | |
echo -e "admin\nadmin" | passwd root >/dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment