LoginSignup
0
0

More than 1 year has passed since last update.

MacでRaspberry Pi Zero 2 WにSSH, Wi-Fi経由で接続するセットアップ方法

Posted at

Raspberry Piのデフォルトのユーザ名とパスワードがpi, raspberryではなく、カスタム設定が必須に変わっていたのでセットアップ方法を簡単にまとめました。

  1. Raspberry Pi OSをダウンロード
    https://www.raspberrypi.com/software/operating-systems/

    Raspberry Pi OS Lite
    Release date: February 21st 2023
    System: 64-bit
    Kernel version: 5.15
    Debian version: 11 (bullseye)

    .xzでダウンロードされるがそのままでOK

  2. OSイメージをSDカードに焼く
    https://www.balena.io/etcher

  3. Finderから消えていたらSDカード抜き差しで再認識

  4. touch /Volumes/boot/ssh (空ファイル生成)

  5. Wi-Fi情報をSDカード内のファイルに書き込む

    /Volumes/boot/wpa_supplicant.conf
    country=JP
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    
    network={
        ssid="NETWORK-NAME"
        psk="NETWORK-PASSWORD"
    }
    
  6. パスワードのハッシュを生成

    echo 'mypassword' | openssl passwd -stdin
    
  7. ハッシュ化されたパスワードをuserconf.txtに保存

    /Volumes/boot/userconf.txt
    username:encrypted-password
    
  8. SDカードをRaspberry Piに戻し電源を接続
    数十秒すれば ssh pi@raspberrypi.local で接続可能に

参考文献

https://desertbot.io/blog/headless-raspberry-pi-zero-w-2-ssh-wifi-setup-mac-windows-10-steps
https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0