How do I know my username? I've installed Ubuntu, but I don't know my username, only my password. I can't access my laptop and it can't be opened.
9 Answers
Open a Terminal and type:
echo $USER
This will print the value of USER environment variable to the console.
- 524
- 6
- 9
Most simple way to find out your username is probably to press ctr+alt+t - this opens terminal and than you will see something like:
user_name@machine_name:~$
And that answers your question.
- 788
You should boot up your Ubuntu in recovery mode. Follow the steps below:
Switch on your computer. Wait until the BIOS has finished loading, or has almost finished. (During this time you will probably see a logo of your computer manufacturer.) Quickly press and hold the Shift key, which will bring up the GNU GRUB menu. (If you see the Ubuntu logo, you've missed the point where you can enter the GRUB menu.) **
Select the line which starts with "Advanced options". *
Select the line ending with "(recovery mode)", probably the second line, something like:
Ubuntu GNU/Linux, with Linux 3.8.0-26-generic (recovery mode)Press Return and your machine will begin the boot process.
After a few moments, your workstation should display a menu with a number of options. One of the options (you may need to scroll down to the bottom of the list) will be "Drop to root shell prompt". Press Return with this option highlighted.
Eventually, you could use this command to list all usernames:
cut -d: -f1 /etc/passwd
I suppose you will be able to recognize your username in the list.
- 4,023
Normally when you start your computer, you don't have to know your username to log on, because it appears automatically in a list. And if it's the only user account, it's the only name listed. It should look like this:

If there is more than one user account, click on the name you want to use. For just one user, all you have to do is type in your password.
If your login screen does not look like that, or logging in does not work, or the problem is that booting fails before you get to the login screen, please let us know, and provide as many details as possible.
- 119,640
- 5,012
Use this solution if you didn't encrypt your home directory.
Do you still have the installation media(LiveCD/USB) from which you installed Ubuntu? Boot from it and select Try Ubuntu.
Go to Files and then, you will see you already installed Ubuntu partition. Click on it, it will mount.
Go to
/home. Here you will see a list of all users on the system that you have created.
To jog your memory, however, what is your name? Did you enter the same name while installing Ubuntu? Do you recall the name that was displayed on the login prompt where you entered your password? Ubuntu by default sets the username as your first name in lowercase.
Example; name= John Doe, automatically set username= john
- 207,228
- 499
- 1
- 6
- 14
I tried many possible usernames and I figured it out from the username_machinename and typed just the first word which is the username. Example: Alice_Inspiron_35_3045 So the username is "Alice".
- 1
