0

I got a new computer at work. It is a pc with UEFI firmware and no grub is accessible (as far as I am aware of). It came with Ubuntu 15.04. When I turned the computer on it logged directly to Ubuntu (without asking any password). Then after sometime it locked and asked for the Password to login with the user User. As I do not have administrative permissions I do not know the password so I just restarted the computer the first time and searched from some clarifications on how to deal with this but with no success (maybe I am not searching with the correct keywords). For this reason I ask you: is there a way to find out this password? Many thanks in advance.

2
  • Why not ask the IT people at work? Jul 24, 2015 at 12:55
  • This password was set in the company where the computer was bought.
    – user432793
    Jul 30, 2015 at 18:04

1 Answer 1

0

You can't find out a password on Ubuntu. Maybe with the use of some hacking tools and brute-force algorithms, but this is not useful in such cases, and it's not necessary.

However you have a few options:

Option 1: The "morally correct" and easiest way

Just call the IT guy of your company that set up your computer and ask him for the password he has set.

If he tells you that no password is set (you can also try this before/instead of calling him/her), you're probably suffering from a bug (?) in the lock screen that always asks for a password, even if there is none. So click on the gear symbol in the panel (bar on top of the screen, symbol in the right corner usually) and select "Switch user..." or something similar. That way, you leave the lock screen and get to the greeter which recognizes whether somebody has a password or not and does accept logging in without a password, if there is none set.

Option 2: The "hacky" way

When you have physical access to the machine, you can log into a root terminal in recovery mode without password and set a new password without knowing the old one for your account.

Therefore, you do as detailedly advised in this answer, or summarized below:

  1. Reboot and enter the GRUB menu. If you're not dual-booting with another OS, it's probably hidden. Holding Shift during boot (it has to appear after the BIOS/UEFI prompt and before Ubuntu starts to load, so press and hold it better too early than too late) should display it though.

  2. From the given options, select the one with the highest kernel version number (if there are many) and the additional phrase (recovery mode).

  3. You'll see another menu, where you please select the option

    root - Drop to root shell prompt
    
  4. You should be located in a "full-screen terminal" now and logged in as root (super user) now. This should look like:

    root@YOURHOSTNAME:~# 
    
  5. First, we need to remount the hard disk now, as we only have read access at the moment, but we need to write. Do this with:

    mount -rw -o remount /
    
  6. Now you can set the password for the user YOURUSERNAME with the command:

    passwd YOURUSERNAME
    

    It asks you type in a password twice (without displaying any character on the screen, you type blindly!) and then tells you it was successful, if you typed it correctly twice.

  7. You successfully have overwritten your user's unknown password with a new one. Restart the machine normally with:

    reboot
    
  8. On the normal greeter screen, log in with your new password (except if automatic login is still enabled, then you don't have to enter it).

Congratulations! You successfully hacked your password! ;-D

3
  • Many thanks for all your answers, help and time. Fortunately it was possible to find out the password contacting the company that sold the computer. They informed which password was set. This means I did not try your suggestions but many thanks for all these informations.
    – user432793
    Jul 30, 2015 at 18:04
  • You could at least accept this answer (by clicking on the grey tick symbol to the left of it, right below the vote count) to show your appreciation. Besides, I also recommended you to ask the guy who set up the computer, so...
    – Byte Commander
    Jul 31, 2015 at 19:22
  • @user432793 You did not accept the answer... Please take the 2-minutes-tour of AskUbuntu.com and you will see what to do.
    – Byte Commander
    Aug 3, 2015 at 18:06

Not the answer you're looking for? Browse other questions tagged .