DId You Forgot You Linux Username, Here
If you can not even log in because you cannot remember your username, there is still a way to recover your data. Note that this guide assumes you’re the only user on the system.
- Boot the system into Recovery Mode through GRUB.
- Select the Root Shell option.
- Type in this command into the terminal window that opens:
1awk -F: '$3 == 1000' /etc/passwd
- Your username will be at the very beginning of the line on one of the returned lines. Typically there will only be one, but there may be more depending on your system.
- Reboot into normal mode and use the username specified.
If you are not the only user, replace the code on step 3. Look for a user with an ID greater than or equal to 1000 by:
awk -F: '$3 >= 1000' /etc/passwd
One of them is bound to be you. Or ask another user on the machine to pull the account list.
Photo by Bernt Rostad