-
-
Save ErnHem/ee37b479ab9a583b181024d8f033ea20 to your computer and use it in GitHub Desktop.
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
| *server* | |
| useradd username | |
| passwd username | |
| su username | |
| *host* | |
| cat ~/.ssh/id_rsa.pub | ssh username@remote_host "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys" | |
| *Disable Password Authentication on your Server* | |
| sudo vi /etc/ssh/sshd_config | |
| ... | |
| PasswordAuthentication no | |
| PubkeyAuthentication yes | |
| ... | |
| sudo systemctl restart sshd.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment