Skip to content

Instantly share code, notes, and snippets.

@tpraxl
Last active April 4, 2019 20:45
Show Gist options
  • Save tpraxl/d0a5866e3f952a4abda34cd074bbe2f8 to your computer and use it in GitHub Desktop.
Save tpraxl/d0a5866e3f952a4abda34cd074bbe2f8 to your computer and use it in GitHub Desktop.
rasberry pi setup over ssh without hdmi

Rasberry Pi setup over ssh without hdmi

SD CARD and SSH setup preparations

WiFi setup

For WIFI to work immediately, add boot/wpa_supplicant.conf with the following content:

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

network={
 ssid="<YOUR NETWORK NAME>"
 scan_ssid=1
 psk="<PASSWORD>"
 key_mgmt=WPA-PSK
}

SSH setup

For ssh to work on first boot, touch ssh (create empty file named ssh on boot partition). The file will be removed, so you would have to add it next time again.

This is where I learned the ssh and WiFi setup information.

To enable it permanently:

$ sudo systemctl enable ssh
$ sudo systemctl start ssh

Login via ssh pi@the-ip-address. Standard password is raspberry. Change it with passwd pi.

Update system

$sudo apt update
$sudo apt upgrade
# prevent problems with cursor keys over ssh by using vim instead of vi
$ sudo apt install vim
# fix security downgrade of wpa_supplicant, introduced by apt upgrade:
$ vim /etc/wpa_supplicant/wpa_supplicant.conf
# Add inside each network block (without leading #): 
# phase1="tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=1"
# openssl_ciphers="DEFAULT@SECLEVEL=2"
#
# Fix Timezone (e.g. for Europe/Berlin)
$ sudo dpkg-reconfigure tzdata
# choose your timezone and submit

Just to be clear about the changes to wpa_supplicant.conf, because you won't be able to log in via ssh again, if you have an error here.

This is how it should look like:

/etc/wpa_supplicant/wpa_supplicant.conf

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

network={
 ssid="<YOUR NETWORK NAME>"
 scan_ssid=1
 psk="<PASSWORD>"
 key_mgmt=WPA-PSK
 phase1="tls_disable_tlsv1_0=1 tls_disable_tlsv1_1=1"
 openssl_ciphers="DEFAULT@SECLEVEL=1"
}

Troubleshooting

I locked myself out

If you can't login again, just turn your device off and plug the SD card into your PC. You can edit and inspect files this way as well.

Locale error messages

Something like Please check that your locale settings […] are supported and installed on your system:

LANG=C sudo dpkg-reconfigure locales

If this doesn't help, see https://stackoverflow.com/questions/2499794/how-to-fix-a-locale-setting-warning-from-perl

To be continued […]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment