Skip to content

Instantly share code, notes, and snippets.

@renbaoshuo
Created February 8, 2022 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renbaoshuo/254bbcd86b258449cb3fc1faec6cf7ac to your computer and use it in GitHub Desktop.
Save renbaoshuo/254bbcd86b258449cb3fc1faec6cf7ac to your computer and use it in GitHub Desktop.
#!/bin/bash
sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config
sed -i 's|UsePAM yes|UsePAM no|g' /etc/ssh/sshd_config
systemctl restart sshd.service
#!/bin/bash
sed -i 's|[#]*PasswordAuthentication no|PasswordAuthentication yes|g' /etc/ssh/sshd_config
sed -i 's|UsePAM no|UsePAM yes|g' /etc/ssh/sshd_config
systemctl restart sshd.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment