Skip to content

Instantly share code, notes, and snippets.

@mrnim94
Created February 9, 2025 02:21
Show Gist options
  • Save mrnim94/dec1d8a1785c4fc9ef0f56428044203b to your computer and use it in GitHub Desktop.
Save mrnim94/dec1d8a1785c4fc9ef0f56428044203b to your computer and use it in GitHub Desktop.
change Pass root
#!/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