Last active
February 12, 2017 13:24
-
-
Save Alex-Just/f14cc28db6f263e4a046b7e9d60cf02e 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
| ssh-keygen -t rsa | |
| cat ~/.ssh/id_rsa.pub | ssh user@host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" | |
| # or | |
| cat ~/.ssh/id_rsa.pub | ssh-copy-id user@host | |
| ssh-add -K ~/.ssh/id_rsa | |
| # You might need to start ssh-agent | |
| eval `ssh-agent -s` | |
| # Force ssh client to use only password auth | |
| ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no user@host | |
| # Use ssh key | |
| ssh -i SMPL.pem -o 'IdentitiesOnly yes' user@host | |
| # Disable password authentication in ssh | |
| sudo nano /etc/ssh/sshd_config | |
| PasswordAuthentication no | |
| sudo service ssh restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment