Pi Awesome

Reference and guides to build kick ass raspberry pi projects.

View the Project on GitHub codingforentrepreneurs/Pi-Awesome

SSH without password each time

This is a quick reference on how to ssh into a host server without using a password. It’s all done through using public keys generated by ssh-keygen

1. Create Public Key

ssh-keygen -t rsa -b 4096

2. Copy public key to host automatically

Windows users must use the manual process below.

REMOTE_HOST=pi@raspberrypi
ssh-copy-id $REMOTE_HOST

3. Copy public key to host manully

For linux/macos

REMOTE_HOST=pi@raspberrypi
cat ~/.ssh/id_rsa.pub |  ssh $REMOTE_HOST "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

Update REMOTE_HOST to your <user>@<remotehost> such as pi@192.168.86.24

For windows

$env:RemoteHost="pi@raspberrypi"
cat ~/.ssh/id_rsa.pub | ssh $env:RemoteHost "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"