Guest User

Untitled

a guest
Jan 23rd, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. ###SSH into a remote machine###
  2. ```
  3. ssh user@mydomain.com
  4. #or by ip address
  5. ssh user@192.168.1.1
  6. ```
  7. __exit:__ `exit`
  8. ###Install Something###
  9. ```
  10. #If it's a new server, update apt-get first thing
  11. sudo apt-get update
  12. #then you can install something - say Git
  13. sudo apt-get install git
  14. ```
  15.  
  16. ###Copy/Deploy files###
  17. ```
  18. #copy all of the files in this directory to the /home/will/newapp directory
  19. rsync -av . will@domain.com:~/newapp
  20. #delete a file and run rsync again, and it only copies the one mising file
  21. ```
  22.  
  23. ###Generate an SSH keypair for passwordless SSH###
  24. ```
  25. #on your computer
  26. cd ~/.ssh
  27. #you might need to make the .ssh directory
  28. ssh-keygen -C "my@email.com"
  29. #hit enter a few times to generate key
  30.  
  31. #copy the file contents to the clipboard
  32. cat id_rsa.pub | pbcopy
  33.  
  34. #log into your machine
  35. ssh user@mydomain.com
  36. #make the .ssh directory and get in it
  37. mkdir .ssh
  38. cd .ssh
  39. #open authorized_keys in nano and paste the contents in
  40. nano authorized_keys
  41. #paste contents in and save by hitting ctrl+x
  42.  
  43. #exit and you can now ssh without a password!
Add Comment
Please, Sign In to add comment