Skip to content

Latest commit

 

History

History
130 lines (76 loc) · 3.5 KB

Raspbian_Post_Install.md

File metadata and controls

130 lines (76 loc) · 3.5 KB

Raspberry Pi: Raspbian - Post-Install Setup logo

Some setup processes to get Raspbian Lite ready to use after initial install

Raspbian download is available from: https://www.raspberrypi.org/downloads/raspbian/

Network Setup


Getting a Raspberry Pi connected to a KVM so you can configure the network is a pain.

An easy way to avoid this is to have the Pi enable SSH when it boots up and make sure a DHCP server will serve it an IP address. You can have the Pi enable SSH on boot up by creating an empty file called 'ssh' on the root folder when you install the Raspbian image.

  1. Create the emtpy file (named "ssh") in the root directory of the SD card to enable SSH on boot up after the image install.

  2. Install the SD card, connect the Pi to a network with DHCP enabled and power it on.

  3. After waiting a few minutes for boot up, SSH to the Pi's DHCP address

  • Log in to SSH with:
    • Username: pi
    • Password: raspberry
  1. Install Network Manager with:
apt install network-manager
systemctl enable NetworkManager
systemctl start NetworkManager
systemctl stop dhcpcd.service
systemctl disable dhcpcd.service

Make sure to stop the DHCPCD service or else the network stack will start resetting every few seconds

  1. Reboot the Pi to have the new network settings take effect
sudo shutdown -r now
  1. Run nmtui once Pi is back up and adjust network settings

Enable Root User


Raspbian has the root user disabled by default and requires you to log in with the default user ("pi") after install. Sometimes we need to enable the root account

  1. Set the root password sudo passwd root

  2. Enable root login with SSH sudo sed -i --follow-symlinks 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config

  3. Restart the SSH daemon sudo systemctl restart ssh

  4. Logout and log back into SSH with the root user exit

  5. Copy the terminal settings from the default user for pretty colors

mv .bashrc .bashrcbackup
cp /home/pi/.bashrc ~/.bashrc

Update the OS


It is always a good idea to update your OS with the latest patches when you build it

Update your Repo list apt update

Install all updates for the OS apt upgrade -y

Set Timezone


Adjust the OS timezone

List the available timezones timedatectl list-timezones

Set your preferred timezone timedatectl set-timezone America/Los_Angeles

Check Temperature


Check the CPU temperature in C head -n 1 /sys/class/thermal/thermal_zone0/temp | xargs -I{} awk "BEGIN {printf \"%.2f\n\", {}/1000}"

Check the CPU temperature in F head -n 1 /sys/class/thermal/thermal_zone0/temp | xargs -I{} awk "BEGIN {printf \"%.2f\n\", ({}/1000*1.8)+32}"

Install Useful Packages


These are some packages I install on almost everything

  1. A useful package that will install python2 and some development tools.

sudo apt install -y python-pip

  1. A GIT client is a necessity if using a GIT repo

sudo apt install -y git

  1. Byobu is a terminal window manager

sudo apt install -y byobu

  1. Fail2Ban will stop repeated attempts at SSH

apt install -y fail2ban