I bought a Raspberry Pi 4, so I made a note of the setup details. SSH, VNC, UFW, etc.
--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
Raspbian Buster with desktop and recommended software
from raspberrypi.org and unzip it..img
to microSD with balena Etchersudo apt-get update
sudo apt-get install xrdp
Change the standby port and change the authentication method
sudo nano /etc/ssh/sshd_config
Port 22
to a suitable portGenerate an authentication key with the RLogin function
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
Create ~ / .ssh / authorized_keys
Copy the public key and paste it into the first line of ~ / .ssh / authorized_keys
Restart SSHD with sudo /etc/init.d/ssh restart
OK if you can reconnect from RLogin
sudo apt install ufw
systemctl start ufw
Enable Firewall with sudo ufw enable
Make a hole in SSH
sudo ufw allow SSH port number
Make a hole in VNS
Connect to Raspberry Pi from Windows RDP
You will be kicked, so look at the log at cat /var/log/ufw.log
The DPT
being kicked was 3389
, so sudo ufw allow 3389
According to help.ubuntu.com, SPT
is the Source Port and DPT
is the Destination Port.
Check the settings with sudo ufw status numbered
Check SSH and RDP connection
Recommended Posts