Cannot login through the command line

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?


Solution 1:

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.