RaspberryPi Raspbian 32bit ヘッドレスインストール


起動用 SD カードの作成

Raspberry Pi Imager で簡単作成 (Windows/macOS/Ubuntu)

Use Raspberry Pi Imager for an easy way to install Raspberry Pi OS and other operating systems to an SD card ready to use with your Raspberry Pi:
https://www.raspberrypi.org/downloads/

GUI でお好きなイメージを。

初回起動時 SSH 有効化

私の環境では、 /Volumes/boot が SD カードの root です。
空の ssh ファイルを作成。

~ ❯❯❯ cd /Volumes/boot
/V/boot ❯❯❯ touch ssh
/V/boot ❯❯❯ ls -la ssh
-rwxrwxrwx  1 user1  staff  0 Sep 25 11:04 ssh

初回起動時 Wi-Fi 有効化

wpa_supplicant.conf に Wi-Fi の情報を記載。

/V/boot ❯❯❯ touch wpa_supplicant.conf
/V/boot ❯❯❯ vi wpa_supplicant.conf
/V/boot ❯❯❯ cat ./wpa_supplicant.conf
country=JP
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="Your-SSID"
    psk="your-password"
}

SD カードを raspberry pi に挿入し、電源 ON

SSH 確認

Raspberry Pi の wifi の mac address を事前に確認しておくといいかも。 私は DHCP でアドレス配布しているルータから mac address で IP address を逆引きします。

Router#show ip dhcp binding | i 01dc.a632
192.168.0.14    01dc.a632.abcd.ef       Oct 02 2020 11:36 AM    Automatic  Active     Vlan1

Raspberry Pi OS のデフォルトクレデンシャルは pi/raspberry

The default user is pi, and the password is raspberry. You can add users and change each user's password.
https://www.raspberrypi.org/

~ ❯❯❯ ssh [email protected]
[email protected]'s password:
Linux raspberrypi 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Sep 25 03:45:02 2020 from 192.168.0.6

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

ユーザ pi のパスワード変更

pi@raspberrypi:~ $ passwd
Changing password for pi.
Current password:
New password:
Retype new password:
passwd: password updated successfully

環境

~ ❯❯❯ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.6
BuildVersion:   19G2021
pi@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:    10
Codename:   buster
pi@raspberrypi:~ $ cat /proc/device-tree/model
Raspberry Pi 4 Model B Rev 1.2