[LINUX] Raspberry Pi 4 setup memo

I bought a Raspberry Pi 4, so I made a note of the setup details. SSH, VNC, UFW, etc.

environment

Physics

--Raspberry Pi 4 Model B / 4GB OK do version --HDMI-> HDMI Micro Conversion Adapter --HDMI monitor --Wired USB keyboard --WiFi router --USB Type C cable and its power supply --Android smartphone (Huawei P30 Pro) --SanDisk microSD

logic

What i did

Get OS

  1. Drop Raspbian Buster with desktop and recommended software from raspberrypi.org and unzip it.
  2. Drop balena Etcher from balena.io and install it
  3. Burn the unzipped .img to microSD with balena Etcher
  4. Insert the microSD into the Raspberry Pi

Rasppie setup

  1. Connect the monitor, keyboard, and powered USB-C cable to the Raspberry Pi
  2. Wait a few minutes and the setup wizard will appear, so proceed appropriately.
  3. Set to connect to the WiFi router on the way
  4. After completing the setup wizard, open the menu with WinKey and enable SSH and VNC in Settings> Raspberry Pi Settings.
  5. Shut down
  6. Unplug everything except the power USB

RDP settings

  1. SSH to Raspberry Pi sudo apt-get update
  2. When you're done, sudo apt-get install xrdp
  3. Confirm connection from Windows 10 Remote Desktop Connection

SSHD settings

Change the standby port and change the authentication method

Change the standby port and external connection

  1. sudo nano /etc/ssh/sshd_config
  2. Change Port 22 to a suitable port

Change of authentication method

  1. Generate an authentication key with the RLogin function

  2. Change to the following settings in sudo nano / etc / ssh / sshd_config

PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys .ssh/authorized_keys2
PasswordAuthentication no
PermitEmptyPasswords no
  1. Create ~ / .ssh / authorized_keys

  2. Copy the public key and paste it into the first line of ~ / .ssh / authorized_keys

  3. Restart SSHD with sudo /etc/init.d/ssh restart

  4. OK if you can reconnect from RLogin

SSH connection from Android

  1. Spit the private key from RLogin
  2. Read the private key with Juice SSH
  3. End

Installing and configuring Uncomplicated Firewall

  1. sudo apt install ufw

  2. systemctl start ufw

  3. Enable Firewall with sudo ufw enable

  4. Make a hole in SSH

  5. sudo ufw allow SSH port number

  6. Make a hole in VNS

  7. Connect to Raspberry Pi from Windows RDP

  8. You will be kicked, so look at the log at cat /var/log/ufw.log

  9. The DPT being kicked was 3389, so sudo ufw allow 3389

  10. According to help.ubuntu.com, SPT is the Source Port and DPT is the Destination Port.

  11. Check the settings with sudo ufw status numbered

  12. Check SSH and RDP connection

Recommended Posts

Raspberry Pi 4 setup memo
Raspberry Pi + Python + OpenGL memo
Install ghoto2 on Raspberry Pi (memo)
OS setup with Raspberry Pi Imager
Raspberry Pi backup
What is Raspberry Pi?
GPGPU with Raspberry Pi
pigpio on Raspberry pi
Raspberry Pi video camera
Raspberry Pi Bad Knowledge
Make DHT11 available on Raspberry Pi + python (memo)
DigitalSignage with Raspberry Pi
Cython on Raspberry Pi
Raspberry Pi system monitoring
Introduced python3-OpenCV3 to Raspberry Pi
Raspberry Pi 4B initial setting
Indoor monitoring using Raspberry Pi
Mutter plants with Raspberry Pi
Install Raspberry Pi OS (Raspbian)
I talked to Raspberry Pi
Raspbian initial settings (Raspberry Pi 4)
Introduced pyenv on Raspberry Pi
Use NeoPixel on Raspberry Pi
Install OpenCV4 on Raspberry Pi 3
Install TensorFlow 1.15.0 on Raspberry Pi
[Raspberry Pi] Minimum device driver creation memo to output GPIO
Port FreeRTOS to Raspberry Pi 4B
[Raspberry Pi] Stepping motor control with Raspberry Pi
Testing uart communication on Raspberry Pi
Use vl53l0x with Raspberry Pi (python)
raspberry pi 1 model b, node-red part 17
Servo motor control with Raspberry Pi
USB over ethernet using Raspberry pi
MQTT on Raspberry Pi and Mac
raspberry pi 4 centos7 install on docker
Serial communication with Raspberry Pi + PySerial
Output from Raspberry Pi to Line
Raspberry pi initial setting (for myself)
Try using ArUco on Raspberry Pi
Try L Chika with raspberry pi
OpenCV installation procedure on Raspberry Pi
A memo when connecting bluetooth from a smartphone / PC to Raspberry Pi 4
VPN server construction with Raspberry Pi
Try moving 3 servos with Raspberry Pi
Power on / off Raspberry pi on Arduino
Detect switch status on Raspberry Pi 3
Install OpenMedia Vault 5 on Raspberry Pi 4
03. Pi
Using a webcam with Raspberry Pi
L Chika on Raspberry Pi C #
[Raspberry Pi] Changed Python default to Python3
Build wxPython on Ubuntu 20.04 on raspberry pi 4
A memo to simply use the illuminance sensor TSL2561 with Raspberry Pi 2
Put ROS melodic in Raspberry Pi 4 / Buster
Measure SIM signal strength with Raspberry Pi
Connect two USB cameras to Raspberry Pi 4
Pet monitoring with Rekognition and Raspberry pi
"Honwaka Notification Lamp" on Raspberry Pi Part 2
[Raspberry Pi] Add a thermometer and a hygrometer
Detect "brightness" using python on Raspberry Pi 3!
Raspberry Pi Security Infrared Camera (Python Edition)