Advertisement
DanPacu

Untitled

Dec 14th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. danpacu@MacdeDan .ssh % ssh-keygen -t rsa
  2. Generating public/private rsa key pair.
  3. Enter file in which to save the key (/Users/danpacu/.ssh/id_rsa):
  4. Enter passphrase (empty for no passphrase):
  5. Enter same passphrase again:
  6. Your identification has been saved in /Users/danpacu/.ssh/id_rsa.
  7. Your public key has been saved in /Users/danpacu/.ssh/id_rsa.pub.
  8. The key fingerprint is:
  9. SHA256:fNigi4D07AKLYIGQbNHpdS4X2lM/XGomb9RGo8YKTPg danpacu@MacdeDan.home
  10. The key's randomart image is:
  11. +---[RSA 3072]----+
  12. |ooo . . |
  13. |+o o o + . + |
  14. |oo. . O + + * . |
  15. |..+. o E = % o |
  16. |+..o + S @ o |
  17. |=... . . o o |
  18. |o. .. . . |
  19. | . |
  20. | |
  21. +----[SHA256]-----+
  22. danpacu@MacdeDan .ssh % ssh-copy-id -i /Users/danpacu/.ssh/id_rsa.pub pi@192.168.1.71
  23. /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/danpacu/.ssh/id_rsa.pub"
  24. /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
  25. /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
  26. pi@192.168.1.71's password:
  27.  
  28. Number of key(s) added: 1
  29.  
  30. Now try logging into the machine, with: "ssh 'pi@192.168.1.71'"
  31. and check to make sure that only the key(s) you wanted were added.
  32.  
  33. danpacu@MacdeDan .ssh % cat id_rsa.pub
  34. ssh-rsa .............
  35. danpacu@MacdeDan .ssh %
  36.  
  37. pi@raspberrypi:~ $ cd .ssh
  38. pi@raspberrypi:~/.ssh $ ls
  39. authorized_keys known_hosts
  40. pi@raspberrypi:~/.ssh $ cat authorized_keys
  41. ssh-rsa ...............
  42.  
  43. pi@raspberrypi:~/.ssh $ sudo chmod 700 /home/pi/.ssh/authorized_keys
  44. pi@raspberrypi:~/.ssh $ cd ..
  45. pi@raspberrypi:~ $ ls -la /home/pi/.ssh
  46. total 20
  47. drwx------ 2 pi pi 4096 dic 14 21:03 .
  48. drwxr-xr-x 26 pi pi 4096 dic 14 20:07 ..
  49. -rwx------ 1 pi pi 575 dic 14 21:03 authorized_keys
  50. -rwx------ 1 pi pi 222 nov 18 21:17 known_hosts
  51. pi@raspberrypi:~ $
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement