🛠 Mettre le B+ en réseau par Ethernet et piloter en SSH
Objectives
Make the Model B+ usable without a screen: obtain an IP address via DHCP on its 10/100 Ethernet port (the board has neither WiFi nor Bluetooth), enable the SSH server, connect to it from a computer, and secure access with a key. This is the foundation for all subsequent tutorials.
Hardware
- Raspberry Pi Model B+ with Raspberry Pi OS legacy 32-bit installed on a microSD card
- RJ45 Ethernet cable to a router/box, micro-USB 5 V power supply
- A computer with an SSH client (OpenSSH, PuTTY)
Complete code
# Sur le B+ (première fois via écran HDMI + clavier, ou raspi-config)
sudo raspi-config # 5 Interfaces de connexion > SSH > Oui
# Sur les images legacy, alternative : créer le fichier d'amorçage
touch /boot/ssh && sudo reboot
# Connaître l'adresse IP obtenue par DHCP (interface eth0 uniquement)
ip -br addr show eth0
hostname -I
# --- Depuis l'ordinateur ---
ssh pi@192.168.1.42
# Clé publique pour éviter le mot de passe
ssh-keygen -t ed25519
ssh-copy-id pi@192.168.1.42
# Diagnostic du bus partagé : Ethernet et USB sont derrière le même LAN9514
ethtool eth0 # 100baseT/Full attendu
vcgencmd get_throttled # 0x0 = aucune sous-tension enregistrée
Expected verification
ip -br addr shows eth0 as UP with an address within the router's range. ssh pi@<ip> prompts for the password and then opens a remote shell; after ssh-copy-id, the connection is passwordless. ethtool confirms 100 Mbit/s full duplex.
Common errors
- Looking for wlan0: the B+ has no WiFi; only the eth0 interface exists (unless a USB WiFi adapter is used).
- Default password changed or pi user missing on a recent image: create the user via the imager's customization tool.
/boot/sshignored on images after Buster: useraspi-configor systemd instead.- Disappointing network speed: this is normal, as the Ethernet and the 4 USB ports share a single 480 Mbit/s USB 2.0 bus (LAN9514); in practice, speeds cap around 10-15 MB/s.
Other tutorials for this board
- Allumer une LED depuis la GPIO 17 avec libgpiod
- Lire un bouton et afficher les appuis dans la console
- Premier script Python : faire clignoter la LED
- Variation d'intensité d'une LED avec le PWM matériel (GPIO18)
- Interroger un capteur I2C (BME280) sur le bus du 40 broches
- Amorçage microSD, pannes de boot et procédure de recouvrement
Code examples for this board
led_blink.pyPythonbutton_led.pyPythonservo_sweep.pyPythondht_temp.pyPythonoled_i2c.pyPythonmcp3008_read.pyPython