How to switch from defaultuser to nemo

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
6 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
8 Likes

I think I found a slightly easier way to do this. I added nemo as a new user with the same uid and gid as defaultuser:

useradd -u 100000 -g 100000 -d /home/defaultuser -s /bin/bash -M -N -o nemo

Then added it to all the same groups as defaultuser:

for group in $(id -nG defaultuser); do usermod -aG $group nemo; done

Everything seems to work fine so far, and it’s far less scary to do than the full rename. But I wonder if something might break at some point.

3 Likes

two users with the same uid and gid? I’m very curious if this will work for long time.
Why do you want to have ‘nemo’ as username? (just for curiosity, and I fully agree that nemo is much more beautiful username than defaultuser)

Just because I have to type it a lot, and ‘nemo’ is much shorter and easier to type than ‘defaultuser’. I could probably get behind ‘captain’ but 10 letters is just too many for a username.

I have set’ up passwordless SSH login on all my computers for all my phones. So I only have to type ssh phonename and i’m immediately logged in.

edit: the same for sftp access from computer to phone to access files. Have bookmarked it in the Linux file manager, so it’s one click and I’m in to exchange files in both directions under Linux desktop GUI.

I’ve done ssh-copy-id for all of them, but I still need to type the username. I didn’t know you could set things up to omit that :slight_smile:

Edit: Yeah that works well. Still not sure if I’m ready to say goodbye to nemo though.

1 Like

Sent you a pm. (20 chars)

I added this to my PC’s ~/.ssh/config and I don’t need to type that long username for ssh at least:

Host jollac2
     User defaultuser
5 Likes

I’ve done this for some years now without having any trouble so far.

The device still see the user as defaultuser but I can type nemo anywhere a username is needed.

3 Likes