Graphical change the user name

I installed Manjaro 24 for a friend - he is not able to use the command line.
How can he change his own user name?
I found no dialog for that.

Thank you in advance.

If youā€™re talking about Linux usernames, then thatā€™s not really possible, even on the command line. Linux usernames are unique identifiers - theyā€™re not meant to be modified. The best way of accomplishing the same effect would be ā€œcreate new user, move across files, delete old userā€

If youā€™re talking about the name displayed, then thatā€™s normally in the Users section of the settings. However, without knowing the desktop environment youā€™re using (Gnome, KDE, XFCE, etc) I canā€™t give you any instructions on this.

He tagged the topic xfce. So on xfce - open the ā€œstart menuā€, click right where where the username with a little generic human (or personal picture) is. Or type ā€œMugshotā€ or ā€œAbout meā€
That is for the display name.

Renaming the profile IS possible, but is a convoluted procedure and can have a lot of side effects. I would not recommend it for a newbie. The login can be changed with usermod but it will leave the home unrenamed, and some settings rely on that nameā€¦

1 Like

This.
And donā€™t forget to make the new user admin as well - or he will not be able to do updates ā€¦ or anything system related (including destroying it, of course :upside_down_face: )

3 Likes

It is possible, at least in the CLI, using usermod and groupmod. I did it once, successfully but there may have been more things to do afterwards which I canā€™t remember as it was many years ago. Anyway if the userā€™s home dir or name is hardcoded in any scripts, config, etc, then they will need updating.

This is really just for information. I havenā€™t tested this, use at your own risk. If you do try it then make sure youā€™ve got a backup just in case.

# renames the user, can't remember if it creates a new UID or not
# creates a new home dir and moves the files over
usermod -d /home/newname -m  -l newname oldname

# renames the group, AFAIK doesn't change GID
groupmod -n newname oldname

https://unix.stackexchange.com/questions/98461/proper-way-of-changing-username-in-ubuntu-or-any-linux

Indeed.

1 Like

yes - there are quite some config files in:
~/.config
~/.ssh
~/.wine
and more

whose content will not automatically be taken care of

So:
even after the procedure, one needs to delete all that and basically start from scratch - taking /etc/skel as a starting point

much easier to just create a new user account ā€¦

2 Likes

Or edit the files, which could be even more work.

Iā€™m not suggesting anyone does itā€¦just saying itā€™s possible.

It certainly will be - unless you are skilled in sed or awk :sunglasses:

But perhaps I just donā€™t know how to use the modern file managers search and replace capabilities. :man_shrugging:

1 Like

I agree with others that creating a new user is the easy way.

Does Manjaro Xfce come with Manjaro Settings Manager? You can use that to manage user accounts and the groups they belong to without doing anything in the terminal.

1 Like

Yes, it does - as far as I know, every Manjaro edition comes with that.

I do not think it has renaming function. Either it needs another account to be able to modify the first one or it just does not have it. At least on a first glance here - src/modules/users Ā· master Ā· Applications / manjaro-settings-manager Ā· GitLab - but C++ is not my first or even second language, maybe i am overseeing it.

No I donā€™t think it does, never tried. Sorry I didnā€™t mean to imply that one could use it to change username.

@dmt Huh - thatā€™s not functionality I was aware of. Thatā€™s actually really useful to know - not for this question specifically, but for Arm-based distros which start from a preinstalled image with a default user.

Sorry, no GUI.

This partially depends on what is set up and what needs handling.

(wine for example would require extra steps, or any special entries in the sudoers file)

I will give you the basics though. We will assume olduser and newuser for the names.

  • Either log out or start from a new boot.

  • DO NOT LOG IN

  • Drop to tty using Ctrl+Alt+Fx (F3, F4, F5, etc)

  • Log in as another user or root at the console.

  • usermod -d /home/newuser -m olduser

  • usermod -l newuser olduser

  • groupmod -n newuser olduser

Note there is still the possibility of some hardcoded paths and the like. Such as mentioned with wine.

You can try to check with some searches;

grep -r olduser /home/newuser/*
grep -r olduser /etc/*

PS.

If you would like this in interactive script form ā€¦ I could be persuaded :wink:

3 Likes

User account. UNIX systems are multi-user platforms, and every individual user in a UNIX system must have a valid account with associated privileges, be it of the generic least-privilege kind or of a specially tailored kind for system services.

Profiles are a staple of individual userland applications ā€” such as browsers ā€” for emulating multi-user functionality on a single-user operating system. They only offer personalized preferences, but they do not offer access control.

The NT-based iterations of Microsoft Windows refer to their user accounts as ā€œprofilesā€ because Microsoft Windows was originally not designed as a multi-user operating system ā€” it initially wasnā€™t even an actual operating system ā€” and even though the NT-based versions of Microsoft Windows support multiple user accounts, these systems still arenā€™t really intended to be used in that manner, given the origins of Microsoft Windows as a consumerist graphical user interface on top of a non-networked single-user operating system, i.e. MS-DOS.

:smirk:

2 Likes
4 Likes

Thank you very much! Right click in start menu does help (curious).

And Thank you to all others too!

System menu or application launcher menu. A start menu is something only Microsoft Windows has. :grinning:

On occasion, Iā€™ve heard it called a SometimesStartMenuā€¦

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.