Raspberry Pi Reset Password Without Keyboard

Raspberry Pis are so convenient considering they’re inexpensive and small, but connecting 1 to its own monitor, keyboard and mouse requires a lot more space and money. If you’re just trying to programme on the Pi or use it to control electronics such as lights, motors and sensors, there’southward no demand to connect it to a display or input devices because you can command the system remotely, using a VNC or SSH customer on your principal computer. We call this screenless install a  headless Raspberry Pi setup.

By default, the Raspberry Pi’due south official operating system, Raspberry Pi OS (formerly known as Raspbian), installs with all forms of remote access disabled. But the proficient news is that you don’t need to connect to a monitor and keyboard in guild to plow them on. By following the instructions below, you can create a headless Raspberry Pi that’s ready for remote access earlier yous kick it up for the very first time. If you have a monitor and keyboard on mitt, you can also see our guide on How to Ready a Raspberry Pi for the Start Time.

Installing Raspberry Pi Bone on Your microSD card

1.Insert a microSD card
into your computer. Your card should exist 8GB or larger (the low-cal version of Raspberry Pi OS will utilize less infinite). We have a list of the best microSD cards for Raspberry Pi to help you choose one that optimizes performance.

ii.
Download, install and run

Raspberry Pi Imager

(opens in new tab)

.

iii.
Click the Cull OS push button.
A menu appears.

(Image credit: Tom’due south Hardware)

iv.
Select your OS.
The best option for most people is Raspberry Pi Os (32-bit). However, if y’all have a Pi three or iv, you tin can use the 64-bit version which is under “Pi Os (other). There are besides other choices.

Choosing Pi OS 32-bit

(Image credit: Tom’due south Hardware)

5.
Click Choose Storage
and
select your bill of fare
from the carte du jour.

Choose storage

(Image credit: Tom’s Hardware)

6.
Click the settings push button
or hit CTRL + Shift + X to bring up the settings carte du jour.

Click settings

(Image credit: Tom’due south Hardware)

A menu appears.

7.
Toggle gear up hostname
and
modify the hostname
if y’all want your device to be named anything other than “raspberrypi.”

Set hostname

(Paradigm credit: Tom’south Hardware)

8.
Toggle enable SSH to on
and
select “User countersign authentication.”

Enable SSH

(Image credit: Tom’s Hardware)

ix.
Set a username and password for your Pi.
Note that if you use the password “raspberry” with username “pi,” you may get a alarm message when yous log in, recommending (but non forcing you) that you change the password.

set username and password

(Prototype credit: Tom’due south Hardware)

10.
Set up your Wi-Fi network’due south SSID, password
and
country.
Then
click Relieve. The country usually defaults to “GB” (Great U.k.) then, if yous are in the U.S., you volition have to ringlet down a really long way to get the country code yous demand.

set wifi settings and save

(Image credit: Tom’s Hardware)

11.
Click Write
and click Yes if asked whether you are certain you want to continue.

click write

(Image credit: Tom’s Hardware)

The system will at present take a few minutes to download the OS and write it to your card.

Writing to card completed

(Paradigm credit: Tom’s Hardware)

When information technology’s washed, you tin pop your card into a Raspberry Pi, boot it up, wait a few seconds for it to get onto the network and try to log in via SSH, provided that y’all’re using a Wi-Fi network and both the Pi and your client PC are connected to it.

Editing Wi-Fi on a Prewritten Menu

Let’s say you already wrote a card, but forgot to enter the correct Wi-Fi credentials in Raspberry Pi Imager. Or perhaps you moved to a different Wi-Fi network. Yous can yet change the Wi-Fi network, without attaching a screen and keyboard to the Pi.

To setup a Wi-Fi connection on your headless Raspberry Pi, open the microSD bill of fare on your PC. Then create a text file called wpa_supplicant.conf, and identify it in the root directory of the microSD bill of fare. You will demand the following text in the file.

        country=U.s.a. ctrl_interface=DIR=/var/run/wpa_supplicant Grouping=netdev update_config=one  network={ scan_ssid=1 ssid="your_wifi_ssid" psk="your_wifi_password" }
      

Change the country to “GB” for the United kingdom or to some other country code for a different country, and enter your actual SSID and password. Upon kick up, Raspberry Pi OS will log you into that network. However, if you’re on a public Wi-Fi network that requires y’all to click “Ok” on a splash folio before you lot get Internet, this method won’t work.

Prefer to use Ethernet? If you plug your Raspberry Pi directly to a wired network, y’all should exist able to access it past its name (raspberrypi or raspberrypi.local) without changing any other files.

Direct USB Connexion (Pi Zero / Cypher W Just)

My favorite way to connect is via a direct USB connection, plugging my Pi Zilch West directly into a port on my PC. This method is dandy, because it works no affair where you are (even if there’s no available Wi-Fi), and it provides both power and a connection to your Pi, over a unmarried cable. Even so, you can only do this on a Pi Zero or Zero W.

one.Open up the file config.txt
in the root directory of the micro SD menu, and
add the line


dtoverlay=dwc2

to the very bottom of the file and relieve.

2.
Open up cmdline.txt and add the text modules-load=dwc2,g_ether
subsequently the word rootwait, and salve the file. There are no linebreaks in this file.

iii.
Download and install

Bonjour Print Services
(opens in new tab)
from apple tree.com (if you have Windows). It seems strange that y’all would need an Apple tree programme to access a Pi from Windows, merely this helps your PC run across the Pi. Ignore the name; you lot’re not using this for printing.

4.
Connect the micro USB cable to the port labeled “USB”
on the Pi Goose egg. This will not work if you connect to the port labeled “PWR.” Yet, the “USB” port will also supply ability to your Pi, so you don’t need to connect a dedicated power wire.

Direct Ethernet Connexion

If your PC has a spare Ethernet port or you have an Ethernet-to-USB dongle, you lot can apply a network cablevision to go directly from your Pi to your computer. Just brand certain that you have Bonjour installed on your PC and SSH enabled on the Pi (run across above). Then, you tin but connect the two devices over Ethernet.

If you lot want the Raspberry Pi to get its Internet connection from your PC over the Ethernet port, you need to do the post-obit in Windows 10 or 11:

1.Navigate to the Network Connections carte du jour, which is role of the sometime-schoolhouse Command Panel. Yous can get to this screen past going to Settings->Network & Net->Wi-Fi and and then clicking “Change Adapter Settings” on the right side of the screen. This works whether you are sharing an Internet connexion that comes to your PC from Wi-Fi or from Ethernet.

two. Right-click on the adapter
that’due south continued to the Internet, and
select backdrop.

three. Enable “Allow other network users to connect”
on the “Sharing” tab.

4. Select the Ethernet port
that is connected to the Raspberry Pi from the “Home networking connection” carte, and click Ok.

Connecting to Your Pi via SSH

After you have the Pi continued to your network or direct to your PC, you lot’ll need to establish an SSH connection.

1.Download and install Putty

if y’all don’t already have it. Putty is the leading SSH client for Windows.

2.Enter the hostname
(by default
raspberrypi
or
raspberrypi.local )



equally the address yous wish to connect to in Putty, and
click Open. You unremarkably need to add the .local if the Pi is directly connected to your PC via USB or Ethernet cable.

three.Click Okif you get a security warning alert. It’southward not a problem.

iv.Enter your username and countersign.

Now you’re connected at the control prompt, but if you want to access the GUI, complete with a desktop and floating windows, you’ll demand to enable VNC.

Enabling and Connecting over VNC

1. Enter


sudo raspi-config

at the command prompt.

A configuration app opens.

2.Select Interfacing Options
(number 5 on the list)

three.Select VNC(number iii on the menu)

4.Select Yes.

five.Striking Enter
to acknowledge the VNC server is enabled.

half-dozen.
Select Finish

On your PC:

i.
Download, install and launchVNC Viewer.

2. Select
New connection
from the File carte du jour.

iii. Enter the host name
(ex: raspberrypi.local)
in the “VNC Server” field. If this does not work, endeavor over again without the .local in the name.

4.
Click Ok.

v.
Double-click on the connection icon
to connect.


half dozen.
Click Ok
if you are shown a security alarm.

7.Enter the Pi’s username and password
when prompted.


Your Raspberry Pi desktop will then appear in a window on your principal reckoner’south desktop. Y’all’ll be able to control everything from there.

Source: https://www.tomshardware.com/reviews/raspberry-pi-headless-setup-how-to,6028.html