It was born like this – pre-enabling WiFi and SSH on Raspberry Pi OS and creating a user

Most of my Raspberry Pis run headless (just remote console, no GUI). To remind myself and for your service I wrote this short memo how to set them up correctly. You can also find the same and much more Pi related information here, but I like to keep the stuff I need together in one place. It contains the instructions how to enable SSH, connect to a WiFi and create a user. This is all done after the Raspberry OS image is written on the SD card for the new Raspberry Pi, so you only have to insert the memory card in the new Pi, connect it to the power and you can do the rest remotely.

Enabling SSH:

Create an empty file called “ssh” on the root dir of the memory card.

Connecting to WiFi:

Create a file called wpa_supplicant.conf in the root dir of the memory card with the following content. Change the country, ssid and psk accordingly.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
country=DE
update_config=1

network={
 ssid="my_wifi"
 psk="my_password"
}

Create a user:

Create a file called userconf.txt in the root dir of the memory card with the following information:
Name of your new user and the encrypted password separated by a colon. To encrypt the desired password you can use an already running Raspberry Pi and type the following in the console. If you don’t have one already running you could also use a publicly available openssl console like this one: https://www.cryptool.org/en/cto/openssl. Always prefer you private console over this for security reasons. But if you like me are just using the Pi internally and for non-critical and private stuff you should be fine.

echo 'mypassword' | openssl passwd -6 -stdin

Copy the result and replace encrypted_password with it.

john:encrypted_password

Credits to inspector gadget!

https://www.pinterest.jp/pin/1900024834272340

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.