Cannot log in: session lasted less than 10 seconds.

Asked by sahibd27

I can no longer logon to ubuntu!!!! I am using 7.10. I think I know the cause of my problem, but I don't know how to fix it. And I really don't feel like having to reinstall ubuntu and all the apps I had before. When I use failsafe terminal mode, I can't really do anything because it cannot find commands such as 'ls' or 'printenv'. When I login to Failsafe GNOME, it just freezes and causes me to shut the computer down through brute force. Any other attempt to login gives me something like this:

'Your session only lasted less than 10 seconds.' Here are the /.xsession-errors details:

process:6150: Gtk-WARNING **: This process is currently running setuid or setgid. This is not a supported use of GTK+. You must create a helper program instead. For further details, see http://www.gtk.org/setuid.html

Refusing to initialize GTK+:
/etc/gdm/Xsession: Beginning session setup...
/etc/profile: 17: id: not found
/etc/gdm/Xsession: 191: ls: not found
/etc/gdm/Xsession: Executing default failed, will try to run x-terminal-emulator
exec: 204: x-terminal-emulator not found

I think what caused this problem is the fact that I changed the /etc/environment, the .bashrc, and the ~/.profile file to add some environment variables. I had to do this for a CS project, and I read that if you want to set environment variables, you do it in this file. Anyway, I changed the path variable:

export PATH=$PATH:/$EC2_HOME/bin

Anyways, I'm a noob to Ubuntu and I don't know how to add environment variables. And I believe that has led to my problem above, but I could be mistaken (but I doubt it).

Please help me.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Robert Di Gioia (digioiar) said :
#1

Hi

I think you're right about this. To restore your path variable in /etc/environment, you will need to use a text based editor such as vi, emacs, or nano. I'm more familiar with vi, so that is what I will describe.

Log into your system in recovery mode. To do this, restart your system. After the BIOS message goes away, you will see a GRUB message at the top of the screen, and a 3 second countdown. Press the ESC key before the countdown gets to 0. This will bring up the GRUB menu. Choose the recovery option, normally it is the second choice.

The system will boot into a text console. You will be root, so be very careful with what you do.

Type the following command:

/usr/bin/vi /etc/environment

This will open up the vi editor with the /etc/environment variable

Use the arrow keys to put the cursor on the PATH line. Then type 2 lower case letter d's as below. This will delete the line.

dd

Now, type a lower case letter o
This will open a new line that you can enter the correct path statement on. Type this line in, with no spaces. Notice that Linux uses : rather than ; as DOS/Windows does

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

Now, press the ESC key. This puts you back into command mode. Now, to save the file and quit type the following sequence

:wq

You should now be back at the console prompt. To restart the system, type

/sbin/shutdown -r now

The system should reboot, and should now hopefully start.

As an FYI, normally only system-wide changes are made in /etc/environment that all users need to have. Changing the path as you described in your ~/.bashrc and/or ~/.profile should be fine.

Good luck.

Revision history for this message
END_MS_BS (mdmc4god) said :
#2

Hi, NOOB here.
 I have just tried to change the login/user info in my xubuntu 7.1.0
I wanted to have firestarter fire up when I logged onto the system. I surmised that if I created a new path for my username,
I would be logged on with root priveleges.........
 I went into the preferences for my user name and altered the path.
I added "root/" or "/root" in front of "home/const/".
("const" being my username)
It NOW says that there is no such directory as root/home/const.
I have been able to view some of the files when I run xubuntu cd from the cd drive.
I would like to know if I can go in & edit the file that contains the path for this username, (you know remove the "root/" that I added to the pathor if I will have to reload the whole program.
Where would I find the user info so that I could undo this terrible thing?

Can you help with this problem?

Provide an answer of your own, or ask sahibd27 for more information if necessary.

To post a message you must log in.