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
Correct. And now, in honor of @slava and wordle, a poem, koan and the next usernames:
Blind
Nonce.
Angle
snake.
knave.
It goes on.
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.
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.
socat is your friend.
Thank you, seems that this did the trick! Phone booted and Terminal app says 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!
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…
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
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.
- Rename homedir and add symlink (just in case)
devel-su
cd /home
mv defaultuser nemo
ln -s nemo defaultuser
- Search for all files in /etc containing defaultuser
grep -sIR defaultuser /etc/
- 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>
- Reboot phone
reboot
Has anyone tried this on the C2 (SFOS 5.0.0.21), yet?
Yes
So far no problems!
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:
-
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. -
Launcher Folder Icons:
Located at~/.config/lipstick
, launcher folder config files containdefaultuser
references if created before the switch. The app icon grouping works, but the icon shapes revert to default. -
several sqlite databases store paths:
- .local/share/system/privileged/Ambienced/ambienced.sqlite
- .local/nemo-transferengine/transferdb.sqlite