Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have added the following line to my .bashrc file to start gnu screen on login:

exec screen

But it seems to go in a loop (may be that is its starting screen also on screen start).

I am not able to access the shell by ssh anymore.

How can this be solved?

Thanks

share|improve this question
up vote 0 down vote accepted

Try using Ubuntu recovery mode.

If that does not work, I suggest using PartedMagic USB stick to boot from and repair your system. You can prepare it using Unetbootin. Using PartedMagic you can mount partitions on your hard drive and edit offending lines from your /home/username/.bashrc.

share|improve this answer

You can use environment variables set by screen to do a simple test.

if [ "$TERM" != screen ] ; then exec screen ; fi
share|improve this answer

Don't put that in your .bashrc. The first thing screen does is starts a shell, which will execute .bashrc, which execs screen, etc. How are you logging in? If via ssh, just use

ssh remotehost screen

To fix the immediate problem, you can login using a different shell so that you can edit your .bashrc. It's very unlikely you don't have one of csh or zsh installed:

ssh remotehost csh

or

ssh remotehost zsh
share|improve this answer

You must log in to answer this question.

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