0

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.

Nikhil
  • 115
  • 3

3 Answers3

4

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

mfinni
  • 36,144
  • 4
  • 53
  • 86
3

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").

jamespo
  • 1,698
  • 12
  • 12
-1

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).

mndo
  • 170
  • 2
  • 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