Cannot login through the command line

5,041

Your fullname (or display name) may be in the form firstname-space-initial-period but your Unix username (as required at the commandline login prompt) will be a single word like john or smithj or janesmith99

If you can't remember what username you used when you set up the account (and you can't open an application such as the Nautilus file manager that would enable you to figure it out - by default, the username will be the same as the final component of the pathname of your home directory), then you can reboot into recovery mode and check for your username in the /etc/passwd file - either by using

less /etc/passwd

to display the whole file, or for example using a command like

awk -F: '/FirstName/ {print $1}' /etc/passwd

where FirstName is replaced by your actual first name (or any other distinguising part of your fullname that you are certain you used) to match and print the relevant entry.

You should then be able to reboot, select the CtrlAltF1 virtual terminal once more, and try again with the recovered username.

Share:
5,041

Related videos on Youtube

user306278
Author by

user306278

Updated on September 18, 2022

Comments

  • user306278
    user306278 over 1 year

    I have only been using Ubuntu for about three weeks so do not be surprised if you lose me trying to explain something, I will try my best to be as detailed when needed though.

    Anyways, Unity right now is borked. Whenever I login after having updated and restarted a few days ago the entire interface is missing. The only things I can see are the background picture and a folder for Blender 3D. Launching Blender causes it to appear then promptly minimize into oblivion. Trying to right click and change the background gives me an error with gnome (as I think it is called) and the desktop terminal (control-alt-T) does not work either. So with all that said and done I have written down a bunch of codes to reset Unity and/or reinstall gnome but I cannot access the command terminal, CTRL-ALT-F1.

    When I come to the login screen I press the command to bring up the command line interface where I am asked to enter my login information. I enter my user name and password and always receive an invalid password error. I was able to access it in the past to install proprietary drivers to use CUDA in Blender but now I cannot. The password works in the basic login screen so I assume that there is something wrong with my username.

    It is simply my first name, a space, then my final initial ended with a period. Could spaces randomly placed before, after, and in the middle be contributing to my problem? Is there any way to copy the username from the login page and paste it into the login portion of the command line?

    • steeldriver
      steeldriver almost 10 years
      Your fullname (or display name) may be in the form firstname-space-initial-period but your Unix username (as required at the commandline login prompt) will be a single word like john or smithj or janesmith99
    • user306278
      user306278 almost 10 years
      Oh, I did not see this here. I will give it a try and let you know how it turns out! :)
    • user306278
      user306278 almost 10 years
      Did not work unfortunately.
  • user306278
    user306278 almost 10 years
    The password is just fine, I can log into my desktop without problem. The problem is that I fear there are random spaces in my user-name since I cannot log into the command-line-interface (what I think it's called, CTRL-ALT-F1) by manually typing in my username. Can the password source files become corrupted so that they think the password for the desktop and command-line are different?
  • user306278
    user306278 almost 10 years
    I forgot to add that I have a dual-boot with Windows 7 in case that means anything.
  • user306278
    user306278 almost 10 years
    I am busy working on a project right now but I will give it a try in a few hours. Wish me luck!
  • user306278
    user306278 almost 10 years
    I managed to login. It turns out the name on the main login page was not the one it was asking for. When I logged normally there was a single folder on the desktop I could open and then navigate to the USER folder and the name of the consecutive folder was the correct name. Only problem now is unborking my desktop. I reinstalled Unity and Gnome, updated and upgraded and still nothing. Only one folder on my desktop and the inability to open any kind of file, everything failing to launch or simply disappearing after doing so.