this post was submitted on 13 Aug 2025
10 points (85.7% liked)

Linux Mint

2672 readers
2 users here now

Linux Mint is a free Linux-based operating system designed for use on desktop and laptop computers.

Want to see the latest news from the blog? Set the Firefox homepage to:

linuxmint.com/start/

where is a current or past release. Here's an example using release 21.1 'Vera':

https://linuxmint.com/start/vera/

founded 4 years ago
MODERATORS
 

Hi fediverse,

I'm hoping someone can give me some advice on an issue that means I can't access the main user account on my Linux Mint (Cinnamon) operating system.

Context:

I'm using a dual boot setup of windows and mint on my laptop. I use mint (or used to, when I could access my user) for pretty much anything that doesn't require things* only my windows instance has. (*things such as support for video games that support windows but not linux, for example)

When creating my main user account, I made a mistake in the username. It was irritating enough for me to want to change it, and as doing so seemed like it should have been fine, I settled upon three guides and ended up (mostly?) just following this one:

https://www.linuxuprising.com/2019/04/how-to-change-username-on-ubuntu-debian.html

I cant remember all of what happened anymore, but I have the following screenshots, along with the stuff I do remember.

(note: red blocks represent the new username, blue blocks represent the old username)

At the used-by-process error, I first tried following the guide precisely, then hoped that "PID" was Process ID, and that the guide expected me to put the ID that usermod stated after "PID", and tried doing that.

Idk if that fvcked something up...

Then I guess I fixed that somehow, idk if I did so by restarting and logging in only as tempuser, or if I had already done that and fixed it some other way.

Anyway I meant to run each line of the command separately to avoid stuff going wrong, but accidentally did both at once. I hoped it'd be fine anyway.

Then stuff happened I guess.

Anyway,

I cant remember much more but I know that I tried to log back in as my main user account and I found out that:

  1. The username had been successfully changed.
  2. I could not log into my main user account.

Imputing the correct username and password was successful, and acted like it was logging me in as usual. Then after the usual black screen, it just throws me back to the login window.

This still happens.

I went through a fair bit of internet searching, followed some advice. All that most people were saying was to check how much disk space you have left - and to not keep timeshift snapshots on the same drive as your OS.

(this is one such post, and (I think) the only one I found that I definitely recognise from the previous searching: https://www.reddit.com/r/linuxmint/comments/15revgg/cant_stay_logged_in_keeps_going_back_to_login/)

I did ctrl-alt-f1 and ran df -h, and deleted most of the timeshift snapshots I had (I think I had maybe 6 and deleted 4 or 5).

Here's the output of df -h that I think is from after I deleted the timeshifts:

Idk what to do, hope someone can advise.

(TL;DR: tried to change username on mint, now whenever I try to log in to the user it throws me back to the login window after the usual black screen. Hope this suffices for a summary...)

top 39 comments
sorted by: hot top controversial new old
[–] MonkderVierte@lemmy.zip 1 points 2 days ago

Looping back happens, because something in profile setup fails. Considering your usrrmod screenshots, maybe X fails to create/access Xauthority/ICEauthority files? To test that, set XAUTHORITY & ICEAUTHORITY variables to somewhere you have acces (must contain the file too) and eun the command the login screen runs (in the config). Lightdm is especially bitchy.

[–] DuckyLoco404@lemmy.world 2 points 3 days ago (1 children)

I tried logging in with tempuser and remembered that I have no idea how to access the files on my main user. In the file manager the home folder for said user isn't accessible, and I assume that's because I set it to be encrypted when setting it up. Thus I can't access the files to copy them over to a new user or anything. Also, I assume I wouldn't be able to rename the homedir as such, and don't know where to start checking or changing user settings and permissions and such.

[–] Fizz@lemmy.nz 2 points 3 days ago (1 children)

Read this thread and try running the ecrypt commands to decrypt your old home folder. Once its decrypted copy what you need back into your new home folder. https://forums.linuxmint.com/viewtopic.php?t=322606

[–] DuckyLoco404@lemmy.world 1 points 3 days ago (1 children)

I was keeping ecryptfs-recover-private/ecryptfs-mount-private as my next option, but would that still work after this stuff d'you think? : [thread:https://lemmy.world/post/34365607/18769865]

(Or if it wouldn't, would moving the old user's home folder back to its original place with the same "mv" command mean it would?)

[–] Fizz@lemmy.nz 2 points 3 days ago (1 children)

In my opinion you should focus on decrypting the old home folder so you dont lose your files. The after that just leave it and use the new user.

Ive never done an encrypted home folder so I'm sorry that I can't help with specifics.

[–] DuckyLoco404@lemmy.world 2 points 3 days ago (1 children)

Ok so I should just try to decrypt it where it is?

[–] Fizz@lemmy.nz 2 points 3 days ago (1 children)

Yeah then copy over what you need.

[–] just_another_person@lemmy.world 2 points 3 days ago* (last edited 3 days ago) (1 children)

So you renamed the username, but that's all it probably changed. I bet your homedir is still under the old username, and your profile paths are all jacked.

Try renaming the old homedir to whatever the new username is, then check all the user settings match for that new homedir name. Change anything that refers to the "old" homedir. Make sure permissions are also set properly to the new user after moving/renaming the directory.

Another option is to just make an entirely new user and copy all your stuff over, but the above should fix things.

[–] DuckyLoco404@lemmy.world 1 points 3 days ago (1 children)

The option to create an entirely new user seems more straightforward and less easy to mess up, no?

[–] just_another_person@lemmy.world 1 points 3 days ago (1 children)

I'd say so. If you don't mind copying stuff over, it's a cleaner solution.

[–] DuckyLoco404@lemmy.world 1 points 3 days ago (1 children)

I tried logging in with tempuser and remembered that I have no idea how to access the files on my main user. In the file manager the home folder for said user isn’t accessible, and I assume that’s because I set it to be encrypted when setting it up. Thus I can’t access the files to copy them over to a new user or anything. Also, I assume I wouldn’t be able to rename the homedir as such, and don’t know where to start checking or changing user settings and permissions and such.

[–] just_another_person@lemmy.world 1 points 3 days ago (2 children)

Do it like this:

  1. Create new user
  2. sudo chown -R newusersnamehere /home/olduserhomedir

Then you'll have access to all the old files while logged in as your newly created user.

[–] DuckyLoco404@lemmy.world 1 points 3 days ago (1 children)

(while logged in to tempuser) I created a new user, and ran the command. Then I logged out of tempuser and into the new user, and checked the home folder to see if i could access anything. Only the following seems to have changed in reaction to the command; while logged in to the new user, the folder for the old user's /home doesn't have a grey square icon with a white "X" anymore, and I can access said folder without inputting a password. The stuff inside the folder remains the same, except now when I try to open the "Access-Your-Private-Data.desktop" file, nothing at all happens, whereas before it would return an access-denied-type error message.

I think I remembered putting in a password to get said error message before, so I added a password to the new user just in case that helped, then tried opening the file again, but it didn't change anything.

(Also, weirdly the password for this new user was required to be a minimum of 8 characters long, whereas the old user's password was required to be six, and the one for tempuser is only four characters. Which is an odd inconsistency)

I also tried accessing tempuser's /home, and that worked, letting me access it via password. I was able to access all of tempuser's files, instead of there just being "Access-Your-Private-Data.desktop" and "README.text". I assume this means that only the original user's home folder is encrypted.

[–] just_another_person@lemmy.world 1 points 3 days ago (1 children)

This is some weird Cinnamon desktop BS, and I don't have all your aettings, so I'm flying blind on that.

Forget the desktop then if you're not sure what you're doing. Create. A new directory under the new users homedir: mkdir ~/oldhome-backup

Then as whichever user has sudo access run: mv /home/whateveroldusersdir /home/newusersdir/oldhome-backup

[–] DuckyLoco404@lemmy.world 0 points 3 days ago (1 children)

I uh... I kind of would have assumed that this was what it'd do, but

Yeah its just moved it all as it was to the new directory.

What do I do now?

(the magenta blocks represent the new username btw)

[–] just_another_person@lemmy.world 1 points 3 days ago (1 children)

Now you CHANGE THE OWNERSHIP of that folder as a showered you before:

sudo chown -R magenta user ./oldhome-backup

Then run this just in case you messed up something with file permissions on that directory previously while running whatever commands:

sudo chmod -R +r ./oldhome-backup

Confirm after running that command that the ownership of the files has changed to the new user. If they haven't, then you something else going on.

[–] DuckyLoco404@lemmy.world 1 points 3 days ago (1 children)

I ran both commands, then checked the owner was the new user and it is. What next?

[–] just_another_person@lemmy.world 0 points 3 days ago* (last edited 3 days ago) (1 children)

Then run through the crypt mount steps: https://forums.linuxmint.com/viewtopic.php?f=42&t=315207

NOTE: That means Step #4 ONLY. You only need to mount the thing, not change it.

[–] DuckyLoco404@lemmy.world 1 points 3 days ago (1 children)

Sorry, I’m not sure I understand

Step #4 of the the guide directs me to "Enter your Mount Passphrase when prompted (as in Step 1)" but step 1 only references logging onto the pc (as such would be to do with the login passphrase if any) rather than the mount passphrase which is instead mentioned in step 2. Does this mean I only need to know the login passphrase or do I have to go through the other steps in order to complete step #4? In which case it doesn't look like I CAN only do step #4

Also, the post by rene (rene » Sun May 31, 2020 7:38 am) seems to suggest that the file to be located at the start of step #4 would be in /home/newuser/oldhome-backup/olduser for me, and since it hasn't seemed to be there I assume it must be hidden by default, which would mean I would have to enable show hidden as described in step #2.3

So I gather I should enable show hidden, then locate the .Private file in /home/newuser/oldhome-backup/olduser?

But then what about the "Enter your Mount Passphrase when prompted (as in Step 1)" part of step #4?

[–] just_another_person@lemmy.world 0 points 3 days ago (1 children)

No, step 4 says to run a mount command to start the process of mounting the encrypted volumenso you can copy things out of it. Like I said...ignore step 1. Only pay attention step 4.

The login password and the encrypted pasdpbrase are two different things in function. Now, maybe you have them the same value and they are the same in that way, but in the technical sense they are two different things. One logs you into your computer, the other secures the encryption on the volume. If you only used one password to login to the machine previously, then just use that same password to unlock the volume after running the mount command.

If that password doesn't work, then you did something during your initial setup that differs, and if you don't have the passphrase to unlock that encrypted volume, you're not getting your stuff back.

[–] DuckyLoco404@lemmy.world 1 points 2 days ago (2 children)

Sorry for taking so long to get back to you.

I tried to run through step #4, but...

"- You need to locate the directory of the .Private file using a file browser."

With the information available, (and after enabling show hidden files,) I could only assume that I should use

/home/.ecryptfs/[olduser's_originalusername]/.Private

Which is the directory the .Private "Link to Folder" file in /home/[newuser]/oldhome-backup/[olduser's_newusername] ("/home/newuser/oldhome-backup/olduser" above) links to. Thus my command would be:

sudo mount -t ecryptfs /home/.ecryptfs/[olduser's_originalusername]/.Private

Running said command however only results in the console returning

mount: /home/.ecryptfs/[olduser's_originalusername]/.Private: can't find in /etc/fstab.

[key]: (blue: old user's original username. red: old user's new username. magenta: new user's username.)

[–] just_another_person@lemmy.world 2 points 2 days ago (1 children)

You need to add a location to mount it to as the last argument. Same command, but add a location at the end like /mnt , or another empty directory you can mount into.

[–] DuckyLoco404@lemmy.world 1 points 2 days ago (1 children)

Yeah, I see the "/media/" bit on the end now - idk why I didn't clock that as something significant, I'll try again with a specified mount point. Thanks for clarifying! (and also thanks @Wolf_Munroe for pointing it out earlier)

[–] just_another_person@lemmy.world 2 points 2 days ago (1 children)
[–] DuckyLoco404@lemmy.world 1 points 1 day ago (1 children)

I ran the command again, this time specifying an empty directory to mount to, but what do I do here?

I'd assume to select option 1, but this dialogue doesn't seem to appear in the "HOWTO: Recover files from encrypted ecryptfs home directory" guide, so I just wanted to check.

[–] just_another_person@lemmy.world 1 points 1 day ago (1 children)

Needs to be an existing directory

[–] DuckyLoco404@lemmy.world 1 points 1 day ago (1 children)

I know, I created the folder "oldhome-mountpoint" in "/home/newuser/oldhome-backup", then copied the path to that and used it as the specified mount point in the command, or at least I thought I did. I'll double check it again

[–] DuckyLoco404@lemmy.world 1 points 1 day ago

I double checked

It seems to exist, and when copying the path it also seems to match the one used in the command.

[–] munroe@dice.camp 1 points 2 days ago

@DuckyLoco404 @just_another_person

Not familiar with ecryptfs but that mount command looks incomplete.

General syntax for mount is:
sudo mount -t <filesystem type> <device or file to be mounted> <directory to mount device or file>

(The -t specifies the following value is a filesystem type.)

The path you've specified is the device or file to be mounted, but no mount point is specified.

Also saw this on Linux Mint forum:
(Recovering files from Encrypted ~.)
https://forums.linuxmint.com/viewtopic.php?t=354385

[–] DuckyLoco404@lemmy.world 1 points 3 days ago

Ok, will do. Thanks!

[–] Mugmoor@lemmy.dbzer0.com 2 points 3 days ago (1 children)

Use the crosspost feature. Posting it in multiple communities just makes it appear in people's feeds multiple times, which is quite annoying.

[–] DuckyLoco404@lemmy.world 2 points 3 days ago

I thought I did use the crosspost feature. Crossposting is the two overlapping squares right?

[–] Auth@lemmy.world 2 points 3 days ago (2 children)

Are you able to login to the gui as any user?

If you're able to login, use the users and groups gui to create a new user with admin perms. Then copy the contents of the home folder into that new user. Once everything seems to be working as it was, delete the other users you no longer want through the users and groups gui.

[–] frongt@lemmy.zip 3 points 3 days ago

Not even at the GUI, I'd try the text console.

You could also boot into recovery mode. Or a live image, and chroot to the system if it's more than just editing files and assigning permissions.

Or, boot a live image, back up your date, and reinstall, making sure not to make typos this time

But really you should check the logs to see why it's failing.

[–] DuckyLoco404@lemmy.world 2 points 3 days ago (2 children)

Thanks for responding! I was still able to login as tempuser last time i checked, so I assume I still can. I'll see if this works, this seems like a really straightforward fix

[–] Auth@lemmy.world 2 points 3 days ago (1 children)

How did you get on, did you get it resolved?

[–] DuckyLoco404@lemmy.world 2 points 2 days ago

I'm kinda just running through @just_another_person's suggestion ([see:thread:https://lemmy.world/post/34365607/18768234]) and if that doesn't work I'll probably see if I can do anything with the ecryptfs-recover-private commands. ([see:thread:https://lemmy.world/post/34365607/18770862])

[–] DuckyLoco404@lemmy.world 1 points 3 days ago

I tried logging in with tempuser and remembered that I have no idea how to access the files on my main user. In the file manager the home folder for said user isn’t accessible, and I assume that’s because I set it to be encrypted when setting it up. Thus I can’t access the files to copy them over to a new user or anything. Also, I assume I wouldn’t be able to rename the homedir as such, and don’t know where to start checking or changing user settings and permissions and such.