DEV Community

ATSU
ATSU

Posted on

Setting Up a Raspberry Pi for Remote Access Without a Monitor or Keyboard

Install the following software for this tutorial

First, start the raspberrypi Imager

Image description

When opened, the following configuration screen will be launched.

Image description

This time, I'll install Raspberry Pi OS (64-bit) Desktop on a 32GB microSD card, using the Desktop version for graphical display via VNC.

Image description

Image description

Write with the following settings

Press 「Next」

Image description

When asked 「Would you like to apply OS customisation settings?」, press 「EDIT SETTINGS」.

Image description

Under the 「GENERAL」 category, set up Wi-Fi and password in the 「OS Customization」 screen.

Image description

Select 「SERVICE」 and enter your Wi-Fi and password. If you wish to configure using a public key, select 「SERVICE」 next to 「GENERAL」 and choose 「Allow public-key authentication only. Set authorized_keys for 'pi':'」

And click「SAVE」

Image description

Image description

When asked 「Would you like to apply OS customisation settings?」, press「YES」.

Image description

Please wait a moment while the Raspberry Pi OS is being written to the microSD card.

Image description

The display will show 「verifying...」 and after a short while, the process will be completed.

Image description

Click 「CONTINUE」 and then follow the on-screen instructions to remove the microSD card.

Image description

Next, insert the microSD card into the Raspberry Pi and power it on.

Enter the following command in the terminal to connect to the Raspberry Pi via SSH. If a password has been set, enter the password to log in.



ssh pi@raspberrypi.local


Enter fullscreen mode Exit fullscreen mode

or



ping pi@raspberrypi.local


Enter fullscreen mode Exit fullscreen mode

Check IPAdress



ssh pi@10.207.171.xxx(IP Address)


Enter fullscreen mode Exit fullscreen mode

If configured as follows, the 'hostname,' 'Username,' and 'Password' will be as follows.

「hostname」: 「raspberrypi」
「Username」:「pi」
「Password」:「raspberry」

Image description

During the first login, you will be asked a question like the following, to which you should respond with 'yes'.



ssh pi@(IPAdress)
The authenticity of host '10.207.171.xxx (10.207.171.xxx)' can't be established.
ED25519 key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxx.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])?


Enter fullscreen mode Exit fullscreen mode


Yes


Enter fullscreen mode Exit fullscreen mode

Once logged in, you will see a prompt like 「pi@raspberrypi:~ $」, indicating that you have successfully SSH connected to the Raspberry Pi.



Linux raspberrypi 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: xxx. xxx. xxx
pi@raspberrypi:~ $


Enter fullscreen mode Exit fullscreen mode

Having established a connection via SSH in the CLI, I would now like to connect graphically using VNC. To do this, it's necessary to enable VNC connections by running 「sudo raspi-config」.



sudo raspi-config


Enter fullscreen mode Exit fullscreen mode

The screen will change to a blue background, switching to the interface for configuring Raspberry Pi settings.

Image description

Select 「3 Interface Options」, Click「Enter」

Image description

Select「I2 VNC」

Image description

「When asked 'Would you like the VNC server to be enabled?」 select 「Yes」.

Image description

This will momentarily switch back to the original black screen. Afterwards, 「The VNC Server is enabled」 will be displayed, so select 「OK」.

Image description

Image description

Now that VNC is enabled, next launch Real VNC.

Image description

Image description

Enter the IP address in the input field at the top

Image description

Finally, enter the Username and Password you set earlier

If the IP address is entered correctly, the following screen will be displayed for the first time, so click 「Continue」.

Image description

Finally, enter the Username and Password you set earlier.

Image description

Doing so will display the Raspberry Pi's home screen.

Image description

Top comments (0)