How to switch from defaultuser to nemo

I think they should change the preset username with every release to a different Nightwish single-worded title. First Nemo, next release Wishmaster, then Sahara and going on like that :wink:

4 Likes

Correct. And now, in honor of @slava and wordle, a poem, koan and the next usernames:

Blind
Nonce.
Angle
snake.
knave.

It goes on.

2 Likes

Thanks a lot for that, I’ll try that, combined with the recovery boot method @attah suggested above.

Well, OpenWRT has been doing that for ages.

Then again a router is slightly different beast than a phone.

1 Like

Um, maybe. I haven’t looked at openwrt for a while, but I doubt that web server running on it does more than ‘start’ as root?

To be honest I haven’t either for a while, but back then there was only root on the device, no users.

1 Like

socat is your friend.

Thank you, seems that this did the trick! Phone booted and Terminal app says nemo.

4 Likes

Confirmed, the user account is not pre-existing in the install image, but created at (first?) boot if not existing.
The other reference is in the connman vpn config file.

Now I have to repackage my modified image and try flashing.

Does img2simg require any special options?

Apparently not: SUCCESS!

3 Likes

The default username is certainly a bit long and boring, ngl, but it doesn’t bother me that much. Neat trick to do it post-install, still!

If only the flashed device would ask the user for an username…

1 Like

I’m very happy this was possible.

I did it pre-install/flashing in the image, which is a bit involved but basically does allow selecting your name of choice.
I didn’t dare to make it elop just yet though…

Extra steps not mentioned in the original post:

  • /var/lib/lxc/aliendalvik/bsp_config

I think that’s generated. I didn’t need to change that anyway.

Does anyone have the list of exact commands to type out? Just in case I screw up the symlink I want to be sure I type in everything correctly.

Also do I have to be logged into my phone via ssh? Or can I do this all from SFOS Terminal?

You can from any console local or ssh. I daren’t even try to list a definite set of commands though without doing it on a new device where nothing would be lost if I get it wrong. I recommend you don’t either :slight_smile:

Fair enough lol. I’ll think about it some more.

I did the following on a clean install yesterday and it seems to work but don’t blame me if it doesn’t work for you.

  1. Rename homedir and add symlink (just in case)
devel-su
cd /home
mv defaultuser nemo
ln -s nemo defaultuser
  1. Search for all files in /etc containing defaultuser
grep -sIR defaultuser /etc/
  1. For each file found replace defaultuser with nemo
sed -i 's/defaultuser/nemo/g' <file_name_here>

If a file is read only then set write permissions first (and restore them afterwards)

chmod u+w <file_name_here>
sed -i 's/defaultuser/nemo/g' <file_name_here>
chmod u-w <file_name_here>
  1. Reboot phone
reboot
5 Likes

Has anyone tried this on the C2 (SFOS 5.0.0.21), yet?

Yes :slight_smile:

So far no problems!

1 Like

I found that I needed to edit /etc/connman/connman-vpn.conf also and rename /var/spool/mail/defaultuser (though that should be harmless).

This is collected from my shell history:

chmod u+w /etc/shadow
chmod u+w  /etc/gshadow
cd /home
mv defaultuser nemo
ln -s nemo defaultuser
vipw
vigr
vim /etc/gshadow
vim /etc/shadow
vim /etc/subgid /etc/subuid
vim /etc/connman/connman-vpn.conf
chmod u-w /etc/shadow
chmod u-w /etc/gshadow
mv /var/spool/mail/defaultuser /var/spool/mail/nemo
cd /home/.appsupport/instance/
mv defaultuser nemo ### MAKE SURE APPSUPPORT IS OFF BEFORE THIS!

grep defaultuser /etc/* -r
find /var/ -name "*defaultuser*"
find /usr/ -name "*defaultuser*"
find /home/.??*  -name "*defaultuser*"

EDIT: There may be some local user settings storing the old home path. If you kept the symlink in home, you won’t notice.
After I removed it I found the following:

  1. An installation of Whisperfish that was done before changing to nemo stored the path /home/defaultuser in some files under ~/.config. These needed to be corrected as well.
    YMMV.

  2. Launcher Folder Icons:
    Located at ~/.config/lipstick, launcher folder config files contain defaultuser references if created before the switch. The app icon grouping works, but the icon shapes revert to default.

  3. several sqlite databases store paths:

  • .local/share/system/privileged/Ambienced/ambienced.sqlite
  • .local/nemo-transferengine/transferdb.sqlite
7 Likes