0

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.

Seth
  • 58,122

1 Answers1

4

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
kos
  • 35,891
  • Thanks kos, but my problem is that I can only login as a guest because of the initial glitch so I don't have permission to run the /etc/passwd command. – Kermit C. Playfoot Sep 01 '15 at 14:11
  • 1
    @KermitC.Playfoot /etc/passwd is 0644, so any user is able to read it: just run one of these in a terminal in your guest session – kos Sep 01 '15 at 14:14
  • But when I type /etc/passwd into the guest terminal screen it says "permission denied" what am I missing? I was traveling yesterday and wants able to try this again and reply sooner. – Kermit C. Playfoot Sep 03 '15 at 16:17
  • @KermitC.Playfoot You don't have to type /etc/passwd. Who stated you have to type /etc/passwd? If you type /etc/passwd bash interprets the command as you're trying to execute /etc/passwd, which you can't (hence the "permission denied" message). Use one of the commands I listed above: start with the third one, which should directly output the username you're looking for. If it doesn't, try the second one or the first one and just go through the list until you find it. – kos Sep 03 '15 at 16:34
  • Found it. The first one I tried worked (meaning the third one) As is probably evident I have little to no experience with the conventions of code / using the terminal function. thanks so much! – Kermit C. Playfoot Sep 04 '15 at 06:40
  • @KermitC.Playfoot You're welcome. Glad that it worked! – kos Sep 04 '15 at 06:54