Created
March 2, 2016 17:47
-
-
Save wicky-andrian/d967b31d52342f413f4c to your computer and use it in GitHub Desktop.
create ssh for vps on ubuntu
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
| #Simple Steps | |
| #If you dont have any ssh on your local pc create one first | |
| $ ssh-keygen -t rsa | |
| Enter file in which to save the key (/home/demo/.ssh/id_rsa): ##this is for name ssh | |
| Enter passphrase (empty for no passphrase): ##this for password | |
| ## After create ssh on your local pc | |
| ##aPaste on your VPS with terminal method (Ubuntu) | |
| $ cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" | |
| ## Finis and open vps with terminal | |
| ## Follow this step | |
| $ sudo nano /etc/ssh/sshd_config | |
| ## Find somthing like this and change be like this | |
| PermitRootLogin without-password | |
| ##save ctrl+x | |
| ##and reload ssh | |
| $ reload ssh | |
| ## Finish , after this when you restart and login again you will be login with ssh only | |
| ## Cheers | |
| ## Article find on : https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment