Raspberry Pi OS
Installation
Ubuntu 22.04
sudo apt install rpi-imager
Create User
NOTE: 新版 Raspberry Pi OS 已經移除內建帳號 pi。使用前需要手動先建立帳號。
Headless Setup
SD Card > Boot partition > File: userconf
userconf:
alang:<encrypted-password>
Generate encrypted password
echo 'mypassword' | openssl passwd -6 -stdin
CLI
# Add user
sudo adduser <username>
sudo usermod -a -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,netdev,gpio,i2c,spi <username>
# Delete user
sudo deluser -remove-home <username>
Enable SSH
Default credential is pi / raspberry
Headless setup
SD Card > Boot partition > File: ssh
(an empty file)
SSH can be enabled by placing a file named ssh
, without any extension, onto the boot partition of the SD Card.
Desktop
- Launch Raspberry Pi Configuration from the Preferences menu
- Navigate to the Interfaces tab
- Select Enabled next to SSH
- Click OK
Option #3: Using the raspi-config
- Enter sudo raspi-config in a terminal window
- Select Interfacing Options
- Navigate to and select SSH
- Choose Yes
- Select Ok
- Choose Finish
Python
Install pip
sudo apt install python3-pip
pip --version
sudo pip install --upgrade pip