Skip to content

Instantly share code, notes, and snippets.

@moeiscool
Created October 3, 2020 03:48
Show Gist options
  • Select an option

  • Save moeiscool/c0ace30e0a25676289bc507205a917a8 to your computer and use it in GitHub Desktop.

Select an option

Save moeiscool/c0ace30e0a25676289bc507205a917a8 to your computer and use it in GitHub Desktop.

Revisions

  1. moeiscool created this gist Oct 3, 2020.
    7 changes: 7 additions & 0 deletions sshPasswordLessLogin.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    PUBLICKEY="YOUR_PUBLIC_KEY_HERE"
    echo "ssh-rsa $PUBLICKEY" >> ~/.ssh/authorized_keys
    cat ~/.ssh/authorized_keys
    sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
    sed -i 's/ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/g' /etc/ssh/sshd_config
    sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
    service sshd restart