cjAlpha
cjAlpha

Reputation: 30

leave AWS EC2 instance properly

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

Answers (2)

idoimaging
idoimaging

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

bigeyesung
bigeyesung

Reputation: 292

Type

exit

if you just want to leave it and keep it running

Upvotes: 1

Related Questions