Methods and precautions for remote control of Raspberry Pi using VNC, SSH, Xrdp, etc.

 The following is a summary of the three methods and precautions used for remote control of the Raspberry Pi. In fact, these three methods are applicable to all Linux systems.

Table of contents

1. ssh control Raspberry Pi

     1. Open ssh service method one

     2. Open ssh service method two

2. VNC remote connection

Three, xrdp remote connection

4. Other matters needing attention


1. ssh control Raspberry Pi

SSH is an encrypted remote login protocol that allows users to remotely access the Raspberry Pi's command line interface through the network. To use SSH to remotely control the Raspberry Pi, you need to enable the SSH service on the Raspberry Pi, and then use SSH client software on the remote computer, such as PuTTY or OpenSSH, to connect to the Raspberry Pi's IP address and the port number of the SSH server.

Here is the download link for PuTTY:

Link: https://pan.baidu.com/s/11ug8SqZE_hFBd-qSnNJODg?pwd=34yx 
Extraction code: 34yx

1. Open ssh service method one

When we enter the IP address of the Raspberry Pi on the home page:

 Just pay attention to the content in the red box. Then click "Open".

After entering, he will ask you to enter the account and password of the Raspberry Pi. The password cannot be viewed, just press Enter after typing, and there is no need to make mistakes.

After entering the account password, enter the command:

sudo raspi-config 

This will enter the configuration tool that comes with the Raspberry Pi system, which is also where the Raspberry Pi system is set.

Press the down arrow, select the fifth "Interfacing Options", press Enter to confirm.

 After entering, select SSH and press Enter to confirm (here, the first is the camera, the third is the VNC remote control service, the fourth is the SPI bus protocol, the fifth is the IIC bus protocol, and the sixth Serial: It is recommended to open the serial port control, after all, it may be used in the future).

 After pressing it, he will enter the interface and ask you whether to enable the ssh service, just select OK.

 After enabling the ssh service, we open Xshell (this software can be downloaded by itself), we create a new session, the protocol uses SSH, the port uses 22, the host enters the IP address recorded by the Raspberry Pi, and enters the account password after connecting.

2. Open ssh service method two

When we use the Raspberry Pi official image burner, we can open the ssh service by ourselves in the settings.

 Precautions:

  • When using SSH to remotely control the Raspberry Pi, it is recommended to use public key authentication to log in to improve security.
  • If you need to use a graphical interface on a remote computer, you can use the X11 forwarding function to display the graphical application on the Raspberry Pi on the remote computer.

2. VNC remote connection

VNC is a remote desktop protocol that allows users to remotely access the desktop environment of the Raspberry Pi through the network. When connecting, you need to enter the IP address of the Raspberry Pi and the port number of the VNC server.

In Method 1 of enabling the ssh service, after entering the Interfacing Options interface, open the VNC service. Then open the VNC control software installed on our computer, here we recommend VNC Viewer.

The download link is as follows: Link: https://pan.baidu.com/s/1IafxKkYLjXRflqT0wd1dnA?pwd=wueq 
Extraction code: wueq

 After opening, enter the IP address and account password.

Precautions:

  • Using VNC to remotely control the Raspberry Pi requires a fast network connection, otherwise there will be delays or freezes.
  • When using VNC to remotely control the Raspberry Pi, it is recommended to use an encrypted connection to protect data security.

Three, xrdp remote connection

To use Xrdp to remotely control the Raspberry Pi, you need to install the Xrdp server software on the Raspberry Pi, and then use a remote desktop client software that supports the RDP protocol on a remote computer, such as Windows Remote Desktop Client or FreeRDP, to connect to the Raspberry Pi IP address and port number of the Xrdp server.

Enter under Raspberry Pi:

sudo apt-get install xrdp

After the installation is successful, open the remote desktop connection on the PC host. Enter the IP address of the Raspberry Pi to enter the login interface. Enter the username and password of your raspberry pie or linux system. to enter.

Precautions:

  • When using Xrdp to remotely control the Raspberry Pi, it is recommended to use an encrypted connection to protect data security.
  • When using Xrdp to remotely control the Raspberry Pi, you need to pay attention to the screen resolution of the Raspberry Pi and the screen resolution of the remote computer to ensure the display effect of the remote desktop.

4. Other matters needing attention

After we remotely control and access the Raspberry Pi desktop, the resolution usually does not match, and we need to change the resolution by ourselves. Recommended blog address:

Raspberry Pi Adjust Resolution_Raspberry Pi Setting Resolution_Dancing Poplar's Blog-CSDN Blog

In addition, if we report an error when VNC controls the Raspberry Pi: The connection was refused by the computer, please check my other blog:

Raspberry Pi VNC control error: The connection was refused by the computer Solved_Haohao fighting! Blog-CSDN Blog

Guess you like

Origin blog.csdn.net/ChenWenHaoHaoHao/article/details/131349699