Skip to content

Instantly share code, notes, and snippets.

@malohtie
Last active July 3, 2019 14:50
Show Gist options
  • Save malohtie/a2c708cc6fa022c6bac040804af20aca to your computer and use it in GitHub Desktop.
Save malohtie/a2c708cc6fa022c6bac040804af20aca to your computer and use it in GitHub Desktop.
Enable password login to your ssh server (redhat)
#!/bin/bash
sed -i 's/#Port 22/Port 22/g' /etc/ssh/sshd_config;
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sed -i 's/PermitRootLogin without-password/#PermitRootLogin without-password/g' /etc/ssh/sshd_config;
echo root:yourpassword | chpasswd;
service sshd restart;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment