Git Product home page Git Product logo

rpi-installation-and-setup's Introduction

RPI-installation-and-setup

SSH-Key generation + installation and setup for Raspberry PI

This guide was made for myself, but can of course help others.

Please note that the OS on the host computer is running Arch and may not be the exact same on your system.

RPI Install notes

OS

Download link: https://www.raspberrypi.org/downloads/raspbian/

Choose raspbian stretch lite, to go run without graphics and preinstalled programs.

Check integrity of file

sha256sum filename.zip

Flash: Balena Etcher

Download link: https://github.com/balena-io/etcher

NOTE: The old Etcher have changed to Balena etcher due to the company changing names.

Extract and run with:

cd Downloads
chmod a+x filename.AppImage
./filename.AppImage
  • Run Balena Etcher
  • Plug in SD-card
  • Flash
  • Plug SD-card into RPI

Generate ssh-keypair:

For more security, we will generate a ssh-keypair, install the public key on remote computer and disable password login.

Guide followed: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

ssh-keygen -t rsa -b 4096 -C "[email protected]"

Enter a file in which to save the key (/home/you/.ssh/id_rsa):

/home/you/.ssh/id_rsa): folder/path/filename

Add SSH-key to SSH-agent

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/filename

Enable SSH on headless boot

https://www.raspberrypi.org/documentation/remote-access/ssh/unix.md

Create a file called ssh with no filetype, at the root folder of boot partion.

Boot RPI

  • Plug in LAN cable to router and PI
  • Plug in power

SSH over to RPI

ssh pi@host
Password: raspberry

Find IP adress of the RPI by logging in to your router.

Default password is raspberry and will be changed.

Add the ip to known host by typing yes

Change Password

passwd

Add user

https://www.raspberrypi.org/documentation/linux/usage/users.md

sudo adduser user_name

Add ssh-key for passwordless login:

https://www.ssh.com/ssh/copy-id

Exit the ssh session with exit

ssh-copy-id -i ~/.ssh/rpi.pub user@host

Test key

ssh -i ~/.ssh/rpi.pub user@host

Disable password login

SSH over to RPI

sudo nano /etc/ssh/sshd_config

Change #PasswordAuthentication yes to PasswordAuthentication no

Restart ssh service on RPI

sudo service ssh restart

Update the RPI

sudo -- sh -c 'apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y; apt-get autoclean -y'
sudo reboot

Extra

Install Pi-Hole

https://github.com/pi-hole/pi-hole/#one-step-automated-install

curl -sSL https://pi-hole.net | bash

Change DNS server on Router or each device to the ip adress of the RPI

Give user sudo rights

sudo adduser username sudo

Set static ip

sudo nano /etc/dhcpcd.conf

Credits

Written with help of this Markdown cheatsheet

rpi-installation-and-setup's People

Contributors

hafpaf avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.