Advertisement
Guest User

Untitled

a guest
Nov 9th, 2016
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. server ip: server-ip
  2. password: password
  3. user: root
  4.  
  5. using SSh
  6. command:
  7. -> ssh root@server-ip
  8. then it will asked for password like bellow
  9. root@server-ip's password:
  10. write password and press enter
  11.  
  12. Now you are in your vps server
  13.  
  14. In this approach, every command ask password in every time.
  15.  
  16. If we want to avoid to enter password in every time,
  17. then we need to go two approach
  18. 1. generate private key
  19. 2. authorize public key
  20.  
  21. let look at 2nd options:
  22.  
  23. For this need to find local pc's public key:
  24. -> ls ./.ssh/
  25. above command will show public key if it exists
  26. id_rsa id_rsa.pub known_hosts
  27.  
  28. Then copy the public key file to vps server
  29. -> scp ./.ssh/id_rsa.pub root@107.191.96.40:~/delwar_rsa.pub
  30. then it will asked for password like bellow
  31. root@server-ip's password:
  32. write password and press enter
  33.  
  34. After that login using SSh
  35. command:
  36. -> ssh root@server-ip
  37. then it will asked for password like bellow
  38. root@server-ip's password:
  39. White password and press enter
  40.  
  41. Then the last command is
  42. -> cat delwar_rsa.pub >> .ssh/authorized_keys
  43.  
  44. above command will append local public key to authorized_keys.
  45.  
  46. Now All is set. Done .
  47.  
  48.  
  49. Now when you connect to your vps using
  50. -> ssh root@107.191.96.40
  51.  
  52. It will never ask you password every time.
  53.  
  54. Yahhhhhhh.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement