[solved] Change my username on cloned system
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
-
- Level 5
- Posts: 577
- Joined: Fri Dec 20, 2019 4:54 pm
- Location: Royston Vasey
[solved] Change my username on cloned system
Not sure how it is called user/ root/ admin name? The one that shows up in terminal with @ in between.
Anyhow this one i want to change on device 2.
I foxcloned the system on device 1 to device 2. This went smoothly! But now i am stuck with 2 same admin names on the 2 devices.
So how can i change the name ( and get rid of the previous) on the new ssd with keeping access to everything as under the cloned name?
Anyhow this one i want to change on device 2.
I foxcloned the system on device 1 to device 2. This went smoothly! But now i am stuck with 2 same admin names on the 2 devices.
So how can i change the name ( and get rid of the previous) on the new ssd with keeping access to everything as under the cloned name?
Last edited by Pepper-Mint-Patty on Fri Oct 23, 2020 5:17 pm, edited 1 time in total.
Language is a virus.
Re: Change my username on cloned system
Why do you want a different admin name? I have 6 laptops with the same admin name. The computer name for each is unique however. My terminal prompt on this machine is reorx@freedom-20. I also have a user named reorx on computers named freedom-19 and freedom-18. The number in the computer's name is the year in which it was purchased... I also have reorx as a user on laptops named freedom-12, freedom-13, and freedom-14 (all still working by the way!
).

Re: Change my username on cloned system
The terminal will display username@hostname where hostname is the name given to the computer ex:office, laptop, etc.
If you want to change the hostname then in a terminal:
Substitute the asterisks with the desired name. Note there is a space
between the asterisks and the rest of the instruction
example:
sudo hostnamectl set-hostname office
If you want to change the hostname then in a terminal:
sudo hostnamectl set-hostname *******
Substitute the asterisks with the desired name. Note there is a space
between the asterisks and the rest of the instruction
example:
sudo hostnamectl set-hostname office
Light travels faster than sound. That's why some people appear smart until you hear what they are saying.
You will seldom see a grey-beard wearing a tinfoil hat.
You will seldom see a grey-beard wearing a tinfoil hat.
-
- Level 5
- Posts: 577
- Joined: Fri Dec 20, 2019 4:54 pm
- Location: Royston Vasey
Re: Change my username on cloned system
thanx, all41. And how change the username?
Language is a virus.
Re: Change my username on cloned system
As pbear is showing changing the actual username is more involved because of groups
and home ownership.
Much easier to just create a new user using Users and Groups from your menu. Give that new user explicit permissions.
Then copy/paste your current /home directory to the new user. Be sure to include the hidden directories and files
beginning with decimal point.
and home ownership.
Much easier to just create a new user using Users and Groups from your menu. Give that new user explicit permissions.
Then copy/paste your current /home directory to the new user. Be sure to include the hidden directories and files
beginning with decimal point.
Light travels faster than sound. That's why some people appear smart until you hear what they are saying.
You will seldom see a grey-beard wearing a tinfoil hat.
You will seldom see a grey-beard wearing a tinfoil hat.
-
- Level 5
- Posts: 577
- Joined: Fri Dec 20, 2019 4:54 pm
- Location: Royston Vasey
Re: Change my username on cloned system
Glad foxclone worked for you
I use the same username/pwd on all my PCs = less to forget, and only change the hostname when I clone from one PC to another, e.g. my thinkpad hostnames are T430, T431 and T432.

I use the same username/pwd on all my PCs = less to forget, and only change the hostname when I clone from one PC to another, e.g. my thinkpad hostnames are T430, T431 and T432.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate
-
- Level 5
- Posts: 577
- Joined: Fri Dec 20, 2019 4:54 pm
- Location: Royston Vasey
Re: Change my username on cloned system
Its nice that some people are happy with their equal usernames on different devices.
Can we now get back to the last question? It looks i am almost there...
Can we now get back to the last question? It looks i am almost there...

Language is a virus.
Re: Change my username on cloned system
I have never changed a users name so I am not completely sure it can be done safely and effectively. If I were trying to do this, I would first create another admin user and log in to that user. I would open the admin Users and Groups tool to see if I could find a way to rename the original admin user. If that didn't work, I would create an admin user of the name that you desire. I would then log in to that user and delete the other admin users (if you didn't want extraneous users hanging around). The delete routine will (probably) ask what you would like to do with the files in the specified user's home folder - choose appropriately. If you don't trust the delete routine, copy those files to a USB stick before deleting. Then restore them with the new admin user.Pepper-Mint-Patty wrote: ↑Sun Oct 11, 2020 8:03 amIts nice that some people are happy with their equal usernames on different devices.
Can we now get back to the last question? It looks i am almost there...
Re: Change my username on cloned system
Are you intending to run your system with both drives connected? The reason I ask is that the partitions on both drives will have identical UUIDs which might confuse BIOS on boot. Normally you would be using clone to switch smaller drive for larger drive or HDD to SSD and when done, format and re-purpose the old drive.Pepper-Mint-Patty wrote: ↑Sat Oct 10, 2020 8:35 amI foxcloned the system on device 1 to device 2. This went smoothly! But now i am stuck with 2 same admin names on the 2 devices.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate
-
- Level 5
- Posts: 577
- Joined: Fri Dec 20, 2019 4:54 pm
- Location: Royston Vasey
Re: Change my username on cloned system
@Reorx, I like this: 'The delete routine will (probably) ask '
@pbear thnx for reminding! somehow i have overseen the link you sent.
@AndyMH The clone is running on a different machine. But it is good to hear whenever i would want to connect the clone to machine-1 i should do it after boot.
I am afraid i should make a bu of all my files first... How risky would the whole procedure be? Scale 1- 10 being 10 the highest risk

@pbear thnx for reminding! somehow i have overseen the link you sent.
@AndyMH The clone is running on a different machine. But it is good to hear whenever i would want to connect the clone to machine-1 i should do it after boot.
I am afraid i should make a bu of all my files first... How risky would the whole procedure be? Scale 1- 10 being 10 the highest risk
Language is a virus.
Re: Change my username on cloned system
Well, it did ask the last time I deleted a user... but that was several years and several versions ago...Pepper-Mint-Patty wrote: ↑Sun Oct 11, 2020 6:34 pm@Reorx, I like this: 'The delete routine will (probably) ask '![]()

Not surprising... thanx pbear!
Re: Change my username on cloned system
Hello, this is how to change your username.
The user I want to change the name of is test2. I want to change to test3. Below shows the test2 home dir.
Use your favorite editor. I like vim. You can use nano if more comfortable with it.
near the bottom of the file you'll find the below line. Change any instance of test2 to test3
should look like this:
Then edit group file.
Find the line that says test2 and change it to test3
then edit the shadow file and do same as above, find test2 and change to test3.
after that the user and ownship part is done. See below how test2 folder is owned by test3 user and group. Last thing to do is to change the name of the test2 directory
Done. Now you can log in with the new username.
Let me know if you have any questions.
The user I want to change the name of is test2. I want to change to test3. Below shows the test2 home dir.
Code: Select all
erik@ipa:~$ cd /home && ls
erik jasmine test2 vicky
Code: Select all
erik@ipa:home$ sudo vim /etc/passwd
sudo password for erik: *******
Code: Select all
test2:x:1004:1004:test2,,,:/home/test2:/bin/bash
Code: Select all
test3:x:1004:1004:test3,,,:/home/test3:/bin/bash
Code: Select all
erik@ipa:home$ sudo vim /etc/group
Code: Select all
test2:x:1004:
Code: Select all
erik@ipa:home$ sudo vim /etc/shadow
Code: Select all
erik@ipa:home$ ls -la
total 24
drwxr-xr-x 6 root root 4096 Oct 11 19:43 .
drwxr-xr-x 24 root root 4096 Jul 20 16:30 ..
drwxr-xr-x 29 erik erik 4096 Oct 11 19:41 erik
drwxr-xr-x 20 jasmine jasmine 4096 Oct 8 07:40 jasmine
drwxr-xr-x 16 test3 test3 4096 Oct 11 19:43 test2
drwxr-xr-x 17 vicky vicky 4096 Sep 4 07:11 vicky
Code: Select all
erik@ipa:home$ sudo mv test2 test3
erik@ipa:home$ ls -la
total 24
drwxr-xr-x 6 root root 4096 Oct 11 20:22 .
drwxr-xr-x 24 root root 4096 Jul 20 16:30 ..
drwxr-xr-x 29 erik erik 4096 Oct 11 19:41 erik
drwxr-xr-x 20 jasmine jasmine 4096 Oct 8 07:40 jasmine
drwxr-xr-x 16 test3 test3 4096 Oct 11 19:43 test3
drwxr-xr-x 17 vicky vicky 4096 Sep 4 07:11 vicky
Let me know if you have any questions.
Re: Change my username on cloned system
@reorx saidhayden wrote: ↑Sun Oct 11, 2020 9:24 pmHello, this is how to change your username.
The user I want to change the name of is test2. I want to change to test3. Below shows the test2 home dir.Use your favorite editor. I like vim. You can use nano if more comfortable with it.Code: Select all
erik@ipa:~$ cd /home && ls erik jasmine test2 vicky
near the bottom of the file you'll find the below line. Change any instance of test2 to test3Code: Select all
erik@ipa:home$ sudo vim /etc/passwd sudo password for erik: *******
should look like this:Code: Select all
test2:x:1004:1004:test2,,,:/home/test2:/bin/bash
Then edit group file.Code: Select all
test3:x:1004:1004:test3,,,:/home/test3:/bin/bash
Find the line that says test2 and change it to test3Code: Select all
erik@ipa:home$ sudo vim /etc/group
then edit the shadow file and do same as above, find test2 and change to test3.Code: Select all
test2:x:1004:
after that the user and ownship part is done. See below how test2 folder is owned by test3 user and group. Last thing to do is to change the name of the test2 directoryCode: Select all
erik@ipa:home$ sudo vim /etc/shadow
Code: Select all
erik@ipa:home$ ls -la total 24 drwxr-xr-x 6 root root 4096 Oct 11 19:43 . drwxr-xr-x 24 root root 4096 Jul 20 16:30 .. drwxr-xr-x 29 erik erik 4096 Oct 11 19:41 erik drwxr-xr-x 20 jasmine jasmine 4096 Oct 8 07:40 jasmine drwxr-xr-x 16 test3 test3 4096 Oct 11 19:43 test2 drwxr-xr-x 17 vicky vicky 4096 Sep 4 07:11 vicky
Done. Now you can log in with the new username.Code: Select all
erik@ipa:home$ sudo mv test2 test3 erik@ipa:home$ ls -la total 24 drwxr-xr-x 6 root root 4096 Oct 11 20:22 . drwxr-xr-x 24 root root 4096 Jul 20 16:30 .. drwxr-xr-x 29 erik erik 4096 Oct 11 19:41 erik drwxr-xr-x 20 jasmine jasmine 4096 Oct 8 07:40 jasmine drwxr-xr-x 16 test3 test3 4096 Oct 11 19:43 test3 drwxr-xr-x 17 vicky vicky 4096 Sep 4 07:11 vicky
Let me know if you have any questions.
@hayden method seems concise and what I have used from root shell. Confused somewhat regarding the shadow file changesI have never changed a users name so I am not completely sure it can be done safely and effectively.
though. Is the shadow file written at boot?
Light travels faster than sound. That's why some people appear smart until you hear what they are saying.
You will seldom see a grey-beard wearing a tinfoil hat.
You will seldom see a grey-beard wearing a tinfoil hat.
Re: Change my username on cloned system
Thanks hayden, that's the most concise method I've seen, no messing around copying files from old user to new user.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate
-
- Level 5
- Posts: 577
- Joined: Fri Dec 20, 2019 4:54 pm
- Location: Royston Vasey
Re: Change my username on cloned system
@hayden, appreciate the work. But feel a bit anxious to execute.
I use Xed, quess thats ok?!
all41 seems to have an important question about shadow file?
@AndyMH appreciate you gave your opinion on hayden's work.
Now lets see how to take on...
There is only 1 user on that machine. So i first need to make a 2nd user with the intended name.
I use Xed, quess thats ok?!
all41 seems to have an important question about shadow file?
@AndyMH appreciate you gave your opinion on hayden's work.
Now lets see how to take on...

There is only 1 user on that machine. So i first need to make a 2nd user with the intended name.
Last edited by Pepper-Mint-Patty on Mon Oct 12, 2020 7:19 am, edited 1 time in total.
Language is a virus.
Re: Change my username on cloned system
Yes you can use Xed if you are more comfortable with a GUI tool.Pepper-Mint-Patty wrote: ↑Mon Oct 12, 2020 6:57 am@hayden, appreciate the work. But feel a bit anxious to execute.
I use Xed, quess thats ok?!
all41 seems to have an important question about shadow file?
@AndyMH appreciate you gave your opinion on hayden's work.
Now lets see how to take on...![]()
Something I forgot to mention, you need to do my method as another user (not logged in to the user you want to change the username). or when at the log in sceen, press Ctrl + Alt + F1. This will change to a virtual console where you can log in to a different user that has sudo privileges or just log in as root. To change back to the normal log in screen, you would press Ctr + Alt + F7
Last edited by hayden on Mon Oct 12, 2020 7:33 am, edited 1 time in total.