migrate ec2 to another vpc code example
Example 1: best way to ssh to ec2 instance through public cloud
# SSH over Session Manager
host i-* mi-*
ProxyCommand sh -c "aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"
Example 2: keep ec2 instance connected on command line
echo 'ClientAliveInterval 60' | sudo tee --append /etc/ssh/sshd_config
sudo service sshd restart