Go to https://raspi.debian.net/ and download the appropriate image file. I\’m going for this one: 20230612_raspi_3_bookworm.img.xz.
Decompress the image:
xz -d path/to/.img
Copy image file to sdcard:
sudo dd if=/path/to/.img of=/dev/sdx bs=4M status=progress conv=sync
Insert the sdcard into your raspberrypi and start it up. First time run will get you prompted to user root without a password so you must give it a password right after login. Remote root login is disabled by default so in order to ssh into the raspberrypi create an admin account give it sudo privileges.\n\n\n\n
Configure as root server-side
Create a password for your root account
passwd
Update the system
apt update && apt upgrade -y
Create an admin account and provide a password
adduser admin
Install dependencies
apt install sudo openssh-server
Give sudo privileges to user admin by navigating to /etc/sudoers.d/ and either edit the README file or create a new file. Add the following line at the end of the file:\n\n\n\n
admin ALL=(ALL:ALL) ALL
Another way to setup sudo on a user is to add that user to the sudo group (you need to be root to do that).
usermod -aG sudo admin
Reboot the system and leave the raspberrypi without logging in locally with the root or admin accounts. From now on you should be able to log in remotely with your user admin and continue with further configurations.
Take note of the ip address of your raspberrypi.
ip a
Configuration client-side
Install open ssh client package.
sudo apt install openssh-client
Connect via ssh in your terminal.
ssh admin@raspberrypi_ip_address
Now you should be able to log in remotely with the admin account and continue with further configurations!
Leave a Reply