Install Raspberry Pi Imager App


  • Enable SSH(Secure Shell) for remote connection

Scan Raspberry Pi’s IP address

Remote connect to PI

1
ssh account@ip-address
1
ssh pigtt@192.168.2.220

Install remote development extension for VSCode

Edit ssh config for convenience

1
/Users/YourUserName/.ssh/config
1
2
3
Host pi5
HostName 192.168.2.220
User pigtt
1
ssh pi5

Enable VNC

  • Enter configuration tool via sudo raspi-config
  • Select 3 Interface Options
  • Enable VNC server

Install VNC viewer on mac

1
brew install vnc-viewer

Add public key to Raspberry Pi

In mac:

1
cat ~/.ssh/id_rsa.pub

In Raspberry Pi:

Add public key to ~/.ssh/authorized_keys.

Fix REMOTE HOST IDENTIFICATION warning

After reinstalling the os for Raspberry Pi, we got this warning when ssh.

1
2
3
4
5
6
7
8
9
10
11
12
13
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:4msrSFkhHN8LoGyAPVADNtMQjY+HKV8anlwzJLAI4V4.
Please contact your system administrator.
Add correct host key in /Users/lufan/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/lufan/.ssh/known_hosts:9
Host key for 192.168.2.220 has changed and you have requested strict checking.
Host key verification failed.

Remove the lines that contain the raspberry pi’s ip address.