Benutzer-Werkzeuge

Webseiten-Werkzeuge


wiki:raspberrypi

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
wiki:raspberrypi [2025/04/01 17:39] – [Temperatur, Takt & Spannung] techguruwiki:raspberrypi [2026/01/03 18:03] (aktuell) – [WLAN SSH on first Boot] pulsar
Zeile 212: Zeile 212:
 ==== WLAN SSH on first Boot ==== ==== WLAN SSH on first Boot ====
  
-Möchte man WLAN beim ersten starten der neuen SD-Karte haben dann muss die Datei ''wpa_supplicant.conf''+=== Nutzer anlegen === 
 + 
 +Um sich per SSH zu verbinden wird ein Nutzer benötigt, die Einstellungen dazu können ab Debian 13 (trixie) 
 +in der Datei ''user-data'' auf der Boot-Partition vorgenommen werden. 
 + 
 +Bisher habe ich in der Datei ''user-data'' die folgenden Zeilen getestet: 
 + 
 +<code> 
 +  hostname: iglu 
 +  ssh_pwauth: ture 
 +  users: 
 +- default 
 +- name: pi 
 +  gecos: Pi-Nutzer 
 +  primary_group: users 
 +  groups: users 
 +  ssh_import_id: foobar 
 +  lock_passwd: false 
 +  passwd: $6$w2zvs/KyKRRl1ZgLfK324dB3H2Ywld8URx1wFH7kZusyVcbd45oYw70AhOay8OIEc1/ 
 +</code> 
 + 
 +Alternativ nur für die Benutzer Erstellung. 
 +Eine Datei erstellen mit dem Namen ''userconf'' mit dem Inhalt: <username>:<password> 
 + 
 + 
 +== PW erstellen == 
 + 
 +Für passwd/password wird hier das verschlüsselt Passwort eingetragen, dieses holt man sich mit dem Komando ''openssl passwd -6'' 
 + 
 + 
 + 
 +(alt) Möchte man WLAN beim ersten starten der neuen SD-Karte haben dann muss die Datei ''wpa_supplicant.conf''
 direkt in die Boot-Partition abgelegt werden. direkt in die Boot-Partition abgelegt werden.
  
Zeile 234: Zeile 265:
 </code> </code>
  
 +
 +=== SSH aktiviren ===
  
 Möchte man SSH beim ersten starten der neuen SD-Karte haben, dann muss die Datei ''ssh'' Möchte man SSH beim ersten starten der neuen SD-Karte haben, dann muss die Datei ''ssh''
-direkt in die Boot-Partition abgelegt werden. Die Datei kann einfach leer sein, das war es auch schon.+direkt in die Boot-Partition abgelegt werden. Die Datei kann einfach leer sein. 
 + 
 + 
 +=== weiteres zu firstboot === 
 + 
 +Interessant könnte für die Konfiguration von firstboot noch dieses Verzeichnis auf der WurzelPartition sein. 
 + 
 +<code> 
 +root@raspberrypi:~# ls -la /usr/lib/raspberrypi-sys-mods/ 
 +total 44 
 +drwxr-xr-x  2 root root 4096 Mar 15 15:01 . 
 +drwxr-xr-x 63 root root 4096 Mar 15 15:02 .. 
 +-rwxr-xr-x  1 root root 3227 Nov  6 15:03 firstboot 
 +-rwxr-xr-x  1 root root  445 Dec 18 10:51 get_fw_loc 
 +-rwxr-xr-x  1 root root  419 Jan  6  2022 i2cprobe 
 +-rwxr-xr-x  1 root root 5486 Nov  7 09:30 imager_custom 
 +-rwxr-xr-x  1 root root 7319 Jul 25  2023 init_config 
 +-rwxr-xr-x  1 root root  117 Aug 31  2023 regenerate_ssh_host_keys 
 +-rwxr-xr-x  1 root root  339 Jul 25  2023 sshswitch 
 +</code> 
 ===== Firmware ===== ===== Firmware =====
  
Zeile 614: Zeile 667:
 Nach der Installation ist es sinnvoll ''raspi-config'' einmal aufzurufen. Dieses Programm findet sich auch in der grafischen Oberfläche oben links auf die Himbeere klicken, Einstellungen --> Raspberry-Pi-Konfiguration Nach der Installation ist es sinnvoll ''raspi-config'' einmal aufzurufen. Dieses Programm findet sich auch in der grafischen Oberfläche oben links auf die Himbeere klicken, Einstellungen --> Raspberry-Pi-Konfiguration
  
- 
-==== 12 Bookworm ==== 
- 
-Ab dieser Version hat sich die Ersteinrichtung für den Headless Betrieb geändert. Hierfür nutze ich das Lite Image. Auf der SD-Karte müss auf der Boot-Partition einige Dateien angelegt werden diese wären: 
- 
-  - SSH Aktivierung, eine leere Datei mit dem namen ''ssh'' 
-  - Benutzer, eine Datei mit dem Namen ''userconf'' mit dem Inhalt: <username>:<password> Für password wird hier das verschlüsselt Passwort eingetragen, dieses holt man sich mit dem Komando ''openssl passwd -6'' 
-  - WLAN, eine Datei im Pfad ''/etc/NetworkManager/system-connections/WLAN-Name.nmconnection'' anlegen mit den folgenden Inhalt: 
- 
-<code> 
-[connection] 
-id=WLAN-Name 
-uuid=# random UUID in the format 11111111-1111-1111-1111-111111111111 
-type=wifi 
-autoconnect=true 
-interface-name=wlan0 
- 
-[wifi] 
-mode=infrastructure 
-ssid=WLAN-Name 
- 
-[wifi-security] 
-auth-alg=open 
-key-mgmt=wpa-psk 
-psk=WLAN-Passwort 
- 
-[ipv4] 
-method=auto 
- 
-[ipv6] 
-addr-gen-mode=default 
-method=auto 
-</code> 
- 
-  sudo chmod -R 600 <path-to-rootfs>/etc/NetworkManager/system-connections/SSID.nmconnection 
-  sudo chown -R root:root <path-to-rootfs>/etc/NetworkManager/system-connections/SSID.nmconnection 
- 
-Hier soll es eine einzige Datei geben, mit der man alle Punkte ab arbeiten kann: 
- 
-With Raspberry Pi OS bookworm you can configure WiFi via a ''custom.toml'' **that you place in the bootfs partition (first boot only).** 
- 
-Note that this feature is experimental and will be replaced by cloud-init in the future. 
- 
-An example gist and blog explains some of the options: 
- 
-I am copying the example from the aforementioned gist (not affiliated): 
- 
-<code> 
-# Required: 
-config_version = 1 
- 
-[system] 
-hostname = "raspberrypi" 
- 
-[user] 
-# If present, the default "rpi" user gets renamed to this "name" 
-name = "rpi" 
-# The password can be encrypted or plain. To encrypt, we can use "openssl passwd -5 raspberry" 
-password = "$5$pN7oRnie.WDOHoJY$aWEYmKUytN/S/bxMza5ksBiurbSJmcvcysBKHSmYa45" 
-password_encrypted = true 
- 
-[ssh] 
-# ssh_import_id = "gh:user" # import public keys from github 
-enabled = true 
-password_authentication = false 
-# We can also seed the ssh public keys configured for the default user: 
-# authorized_keys = [ "ssh-rsa ... user@host", ... ] 
- 
-[wlan] 
-ssid = "mywifi" 
-password = "$5$pN7oRnie.WDOHoJY$aWEYmKUytN/S/bxMza5ksBiurbSJmcvcysBKHSmYa45" 
-password_encrypted = true 
-hidden = false 
-# The country is written to /etc/default/crda 
-# Reference: https://wireless.wiki.kernel.org/en/developers/Regulatory 
-country = "IE" 
- 
-[locale] 
-keymap = "gb" 
-timezone = "Europe/London" 
-</code> 
- 
-You could dig more into the firstboot or init_config scripts (the latter is what loads the config). 
- 
- 
- 
- 
-Entscheident ist dieses Verzeichnis auf der Wurzel-Partition wo die Einstellungen konfiguriert werden. 
- 
-<code> 
-root@raspberrypi:~# ls -la /usr/lib/raspberrypi-sys-mods/ 
-total 44 
-drwxr-xr-x  2 root root 4096 Mar 15 15:01 . 
-drwxr-xr-x 63 root root 4096 Mar 15 15:02 .. 
--rwxr-xr-x  1 root root 3227 Nov  6 15:03 firstboot 
--rwxr-xr-x  1 root root  445 Dec 18 10:51 get_fw_loc 
--rwxr-xr-x  1 root root  419 Jan  6  2022 i2cprobe 
--rwxr-xr-x  1 root root 5486 Nov  7 09:30 imager_custom 
--rwxr-xr-x  1 root root 7319 Jul 25  2023 init_config 
--rwxr-xr-x  1 root root  117 Aug 31  2023 regenerate_ssh_host_keys 
--rwxr-xr-x  1 root root  339 Jul 25  2023 sshswitch 
-</code> 
  
  
wiki/raspberrypi.1743521968.txt.gz · Zuletzt geändert: 2025/04/01 17:39 von techguru