Skip to content

Instantly share code, notes, and snippets.

@dolby360
Last active October 29, 2024 11:54
Show Gist options
  • Save dolby360/eaf02708023bd6de209986ed42d72edc to your computer and use it in GitHub Desktop.
Save dolby360/eaf02708023bd6de209986ed42d72edc to your computer and use it in GitHub Desktop.
Cheet shit for setting up a rasberry pi.

Before inserting the card: Add a file called ssh Add another file called wpa_supplicant.conf with:

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="NETWORK NAME"
    psk="PASSWORD"
    key_mgmt=WPA-PSK
}

Install dhcp

sudo apt update
sudo apt install dhcpcd5

To disable IPv6 for the eth0 interface, you can add the following line to the file /etc/sysctl.conf

net.ipv6.conf.eth0.disable_ipv6 = 1

Restart Networking Service

sudo sysctl -p
sudo systemctl restart networking

Verify dhcpcd Configuration /etc/dhcpcd.conf

interface eth0
static ip_address=10.0.0.20/24

After making changes, restart the dhcpcd service:

sudo systemctl restart dhcpcd

Sometimes, a simple reboot of the Raspberry Pi can resolve network connectivity issues.

sudo reboot

Generate an SSH key pair (if you haven't already):

ssh-keygen -t rsa

Copy the public key to the remote host:

ssh-copy-id [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment