Server Fault is a question and answer site for system and network administrators. 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 a bad Internet connection, it disconnects frequently and on reconnect, I'm assigned a different IP address by the ISP.

The problem is that I connect to a remote VPS (Ubuntu), and when Internet connection is disrupted n reconnected, I can no longer do anything on the terminal. I have to restart the terminal and re-initiate the connection.

Is there a way I can have persistent connection with server.

share|improve this question
up vote 4 down vote accepted

Use "screen" as soon as you log into the Ubuntu server.

share|improve this answer
how do I use screen ? – Nikhil Jun 21 '11 at 8:48
"man screen" will tell you all you need to know. – mfinni Jun 21 '11 at 10:50
I believe the screen program is now implemented as byobu. Try that. – senorsmile Aug 10 '11 at 18:36

In addition to the screen suggestion, you could use autossh on your client

As the autossh page says

Use with "screen" for perpetual session (see included script "rscreen").

share|improve this answer

The easiest way is to install a dyndns ( client (just search for dyndns with your package manager) on the machine that everytime the ip changes updates the DNS record so you can always connect using the same address (something like

share|improve this answer
Nope - His machine (the client) is the one with the dropped connections and changing IP addresses, not the VPS that he's logging into. – mfinni Jun 20 '11 at 16:10
I don't think that's what the OP was after. Its the remote VPS the OP is connecting to, not his home computer – TheLQ Jun 20 '11 at 16:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.