-1

PROBLEM:

I have an AWS EC2 Ubuntu 16.04 machine set up to change IP every 5 minutes. I need to work via SSH on it, but this is obviously hard as the terminal console freezes and then I have to reconnect by typing the new IP. An alternative I tested already is to use noip.com, with a dynamic DNS, but the console still freezes and I normally need to wait for a couple of minutes until the DNS propagates.

QUESTION:

Do you know any possible option to solve this problem? I want to keep my SSH session alive despite the frequent IP changes.

juanba1984
  • 357
  • 2
  • 13

1 Answers1

0

The problem occurs due to wrong configuration of EC2 instance at the time of launching new instance, Try to make a new instance and configure Configure Security Group wisely.If this will not work then try to do

    cd ~/.ssh
    sudo nano config

Add the variables and their values

    Sets number of server alive messages which may be sent without ssh 
    receiving any messages back from the server.

    ServerAliveCountMax 3

    # Timeout interval (in seconds) after which if no data has been received 
    from the 
    server, ssh will send a message 
    # through the encrypted channel to request a response from the server.

    ServerAliveInterval 5
Vardaan Shukla
  • 876
  • 1
  • 6
  • 10