Saturday, July 13, 2019

login - How do I find out my username while locked out of my account



My initial problem was that my computer wouldn't let me login to my account. It seems to shut down after I enter my password. I can login as a guest.



I found fixes but I can't remember / figure out my login for access after I hit Ctrl+Alt+F1 and most of the fixes for finding your login username depend on you having access to your account.



I thought the login was the name which appears on the screen when I start the computer normally, but this has not worked, is there another way to find out my username while being effectively locked out of my root-user profile?



I am also assuming that the password is the same one I always use.




Conversely, if the name which appears on the screen at startup and my normal password should have worked, is there another explanation for why I am not able to login on the black command screen.



All the users in the system are listed into the /etc/passwd file:



cut -d ':' -f 1 /etc/passwd | less


Since UIDs by default range from 1000 to 60000, you may narrow down the list using this:



grep '[^:]*:[^:]*:\([1-9]\|[1-6][0-9]\)[0-9][0-9][0-9]' /etc/passwd | cut -d ':' -f 1 | less



However by default the user created during the installation process has UID 1000, so if that's the user you're looking for you may simply run this without going through any list:



grep '[^:]*:[^:]*:1000' /etc/passwd | cut -d ':' -f 1

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...