Reputation: 30
I am new to AWS EC2 instance. I use ssh to connect to the instance and just want to know how to leave the instance properly. Sometimes I just close the terminal but I couldn't connect to it next time. Then I use
shutdown -h now
It works, but this way I need to restart the instance next time. Is any proper way to leave the instance?
Upvotes: 0
Views: 379
Reputation: 784
The EC2 instance runs independently of you connecting to it. Each time you SSH in to the instance you start a new interactive shell. exit
or Control-D will close the shell that you have logged in to, and leave the instance running.
If your instance is on-demand, you can shut it down to save costs, but that is an entirely separate operation from logging in and out.
Upvotes: 0