Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- danpacu@MacdeDan .ssh % ssh-keygen -t rsa
- Generating public/private rsa key pair.
- Enter file in which to save the key (/Users/danpacu/.ssh/id_rsa):
- Enter passphrase (empty for no passphrase):
- Enter same passphrase again:
- Your identification has been saved in /Users/danpacu/.ssh/id_rsa.
- Your public key has been saved in /Users/danpacu/.ssh/id_rsa.pub.
- The key fingerprint is:
- SHA256:fNigi4D07AKLYIGQbNHpdS4X2lM/XGomb9RGo8YKTPg danpacu@MacdeDan.home
- The key's randomart image is:
- +---[RSA 3072]----+
- |ooo . . |
- |+o o o + . + |
- |oo. . O + + * . |
- |..+. o E = % o |
- |+..o + S @ o |
- |=... . . o o |
- |o. .. . . |
- | . |
- | |
- +----[SHA256]-----+
- danpacu@MacdeDan .ssh % ssh-copy-id -i /Users/danpacu/.ssh/id_rsa.pub pi@192.168.1.71
- /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/danpacu/.ssh/id_rsa.pub"
- /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
- /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
- pi@192.168.1.71's password:
- Number of key(s) added: 1
- Now try logging into the machine, with: "ssh 'pi@192.168.1.71'"
- and check to make sure that only the key(s) you wanted were added.
- danpacu@MacdeDan .ssh % cat id_rsa.pub
- ssh-rsa .............
- danpacu@MacdeDan .ssh %
- pi@raspberrypi:~ $ cd .ssh
- pi@raspberrypi:~/.ssh $ ls
- authorized_keys known_hosts
- pi@raspberrypi:~/.ssh $ cat authorized_keys
- ssh-rsa ...............
- pi@raspberrypi:~/.ssh $ sudo chmod 700 /home/pi/.ssh/authorized_keys
- pi@raspberrypi:~/.ssh $ cd ..
- pi@raspberrypi:~ $ ls -la /home/pi/.ssh
- total 20
- drwx------ 2 pi pi 4096 dic 14 21:03 .
- drwxr-xr-x 26 pi pi 4096 dic 14 20:07 ..
- -rwx------ 1 pi pi 575 dic 14 21:03 authorized_keys
- -rwx------ 1 pi pi 222 nov 18 21:17 known_hosts
- pi@raspberrypi:~ $
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement