Raspberry Pi removes default user id, 'Pi'

Another thing, on selecting the timezone. It should be part of the boot time setup so manual change is not required. That too is a long pending item from the to-do list.

@Kyle_Rankin, how about this part? :slight_smile:

I think it’s inflammatory language designed to elicit an emotional response :smiley:

We obviously do not want to ‘control’ the username, but the default username is simply an artifact of how we originally set things up. I’m sure we’d welcome any MRs that remove those dependencies on that username if someone wants to work on it. Otherwise it’s something I’m sure we will get to at some point, but other things are taking priority.

6 Likes

How about a quick refresher to re-analyze and re-invent: the intro and setup could use some love - specially if more and more less linux savvy users that have less time to learn stuff and study the forum? A walkthrough on how to harden and get most security benefits out of L5 might be useful to all. Something more to the todo-pile…

Currently, we run the first-time setup on an already fully booted and logged in system. Eventually we want to move into using an “installer” like approach that other distros are using that could do things like reencrypt the rootfs and set up user accounts before the actual system is fully booted, but we’re not there yet.

BTW. I don’t think there should be any problems with having the name changed. What may be problematic is renaming an already existing user while retaining its home dir intact, but if you’re willing to start fresh it should all work (if it doesn’t, it’s worth a bug report :))

3 Likes

I am willing to start fresh. I flashed my Librem 5 with noluks option. The maximum disk size is only 3 GB by default. I had to resize it. Next, I used the usermod command to rename it. But it does not work as expected. As you mentioned the home directory name does not change.
Can you share the steps? I will see if it works otherwise will raise a bug.

@dos Is that a bug or is it intentional to cap the default disk size to 3 GB and then resize it?

AFAIK, for non-LUKS image it should get resized to full eMMC size on first boot automatically.

Exactly. It does not work. Period.

It is well-known, by Purism and (some) customers, that it does not work. It has been discussed in this forum before.

Purism may get to it eventually but it is “lower priority”, as stated in their first response above.

If a customer is not using SSH login via asymmetric keys only then … one ‘workaround’ is to configure SSH to allow login only from selected users and by implication disallow login from purism and by implication create the user that you would actually like to have remote access under - so that it won’t make any difference whether the user purism exists or not from that perspective.

There are lots of reasons why making this change retrospectively may be problematic. So it is likely that if and when Purism does make such a change, you will either have to reflash (potentially a large hassle) or you just bodgy in the selected needed changes (which in theory you can do today, but I wouldn’t recommend it unless you know how to recover from software breakage).

I actually agree with you. There should not have been a default username and, if there is one, it is not even logical that it is purism but on a scale of things going wrong in the world today even for me it is “lower priority”. :wink:

I think that is true of the Pi as well.

The real question (on Pi or Librem 5) is whether the installer / first boot process forces the user to change the default password. I believe that on Librem 5 the answer is “no” and this should be looked at, particularly as the number of phones in unsophisticated hands increases. The downside is the support cost of people who immediately lock themselves out by forgetting the password that they just set. So there needs to be a documented recovery process e.g. using Jumpdrive.

Yes, that is exactly right. The non-LUKS image flashed with the ./librem5-flash-image command is able to read the 32GB properly.

But the LUKS images flashed with ./librem5-flash-image --dist byzantium --variant luks option has to be manually resized to see full 32GB disk.

I’m sure there are a few ways to do it, I did it with a simple systemd unit…

[Unit]
Description=Change the default purism username
Before=user@1000.service

[Service]
ExecStart=/bin/bash -c "/usr/sbin/usermod -l loki -d /home/loki -m purism && /usr/sbin/groupmod -n loki purism"

[Install]
WantedBy=default.target

You’d want to change all instances of “loki” to what ever username you want as once the service is enabled, this will change the default username to “loki”, change the home directory and copy the current purism home directory to /home/loki and also rename the purism user group to “loki” on the next boot.

I haven’t noticed any ill effects from changing this, however, I didn’t use the phone very much. I would like to think that anything requiring the default user would reference the user by UID rather than name?

3 Likes

I can test it more. Can I know the exact file where this content can be added or the file to be modified?

Create the file with the above contents and save it in your home directory as change-username.service

Then from within the terminal in your home directory, change ownership of the file to root…

sudo chown root:root change-username.service

Move the file to the systemd service directory (note: the trailing slash is important)…

sudo mv change-username.service /etc/systemd/system/

Then enable the service…

sudo systemctl enable change-username.service

Then reboot. After rebooting, your username, home directory and user group should all be changed. You should then disable the service…

sudo systemctl disable change-username.service
4 Likes

Thanks much for a super detailed response. I will keep you posted on how it works out with normal operations of the phone. Thanks again.

This worked like a charm. Thanks

For the record, if you have any cron jobs in the system crontab file and those jobs run as purism then I doubt the system will handle that i.e. you would have to edit crontab yourself.

Perhaps there are other references to purism or ~purism or both.

It could depend on how long you have had your phone. A newly flashed phone would have fewer such issues.

As mentioned within the caveats section man usermod

A newly flashed phone is not likely to have any such problems as there are no cron jobs installed by default (the last I checked). Additionally, most reasonably up to date utilities and applications that require any scheduling are likely to use systemd timers (which PureOS supports) when/where available so I would not expect it to be much of an issue going forward.

1 Like

… except for, um, old-timers like me who just use what they know.

2 Likes

Good to know, I’ll be interested to hear if you run into any issues related to the change, not that I’m expecting it.

Then that would be an issue brought by yourself, so it’d be on you update/correct it.

I myself stayed in the happy safe place of sticking to the tools and utilities that I knew well and had been using for many years. However, it occurred to me that at some point many if not all of these tools and utilities will become deprecated and may disappear all together. Additionally, it becomes very difficult to impossible to efficiently and effectively troubleshoot a modern system with older tools.

2 Likes