rpi-distro / userconf-pi Goto Github PK
View Code? Open in Web Editor NEWRaspberry Pi tool to rename a user
Raspberry Pi tool to rename a user
I tried many times now to make a headless RPI boot and setting the user and password using the new /boot/userconf.
And it works great except for one thing - it always set the login default to automatic text login.
I don't think this is the expected behavior.
In my "image" i remove /etc/systemd/system/[email protected]/autologin.conf and run systemctl --quiet set-default multi-user.target
, but the problem seems to be that when the userconf-service is handling the userconf - the flow seems to be like this:
Userconf-service get to this line (which is rename but also set the new password):
Which then will hit this:
Which again will hit this:
Line 28 in 602561b
Thereby calling raspi-config to set it to B2 Console Autologin
Im not sure why renaming the username or/and setting the password should cause any changes to the login behavior but I might be missing something
sshd has the ability to send a pre-login banner by setting Banner in /etc/sshd_config to point to a text file e.g. /etc/sshd_banner. A message about the pi user no longer being accessible by default could be added in there. userconf-pi can delete the notification banner and remove the Banner config from /etc/sshd_config once it has run.
This should help with some of the current confusion about the pi user change.
If you are requiring headless to set a password, please provide a way to load a set of public SSH keys (ed25519, RSA, etc) on the user after it has been renamed, and then disable password authentication for all users after boot. This is way more secure, vs renaming users and changing passwords. I'd rather the distro uses this as a default vs trying to manage passwords of these devices. Maybe have the first startup look for a /boot/ssh_pubkeys (one public key/line) and it will add the public keys to the user, and then turn off password auth.
I opened an issue in rpi-imager, but they are pointing it to userconfig-pi project:
raspberrypi/rpi-imager#540
Maybe somebody can take a look?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.