Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

3 Answers 3

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
add comment

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
add comment

The easiest way is to install a dyndns (https://www.dyndns.com/account/services/hosts/add.html) 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 yourmagine.dyndns.org).

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
add comment

Your Answer

 
discard

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.