Created
October 13, 2020 01:51
-
-
Save rosswd/f3a8dde974a84a5422c1c680d5af1f4e to your computer and use it in GitHub Desktop.
Set up ssh on a Raspberry Pi
This file contains 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
# ssh on raspberry pi | |
# in these examples I use 192.168.1.10 as an example ip address for the raspberry pi | |
# enable ssh either using raspi-config or by placing a file named 'ssh' in the boot partition | |
# connect from a client | |
ssh [email protected] | |
# set up passwordless access | |
## | |
# check for existing keys on the client ('id_rsa.pub' file) | |
ls -la ~/.ssh | |
# if no public key found | |
ssh-keygen | |
# copy key over to the raspberry pi using ssh-copy-id | |
ssh-copy-id [email protected] | |
# test your connection | |
ssh [email protected] | |
# connect using an alias | |
## | |
# create the config file | |
touch ~/.ssh/config | |
vim ~/.ssh/config | |
# example file (macos) | |
Host * | |
AddKeysToAgent yes | |
UseKeychain yes | |
IdentityFile ~/.ssh/id_rsa | |
Host rpi | |
User pi | |
Hostname 192.168.1.10 | |
# connect | |
ssh rpi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment