When there is need often to log in to your AWS hosted EC2 instance, and you care at least a bit about security, one will need to update the Security Group „Inbound rules“ to allows SSH connection from your current IP address to your Amazon AWS hosted server.

You have two option to do so:

  1. Log In to AWS Management Console and click through the menus, until you find where to update your „Inbound Rules“ for the specific Security Group.
  2. Or: You just prepare a simple script that will use the Amazon CLI and update the rules, investing now ten minutes of your time.

I will show you how to implement the Security Group updates through AWS CLI for Windows. Of course, you may use it for other ports than just SSH.

  1. Download and install the CLI for Windows as MSI Installer or via PIP or bundled installer, when on Linux OS X or Unix.
  2. Test if AWS CLI is working, by opening a command prompt, running aws –version
  3. Login into AWS Management Console and navigate to your Dashboard, showing user details.
    Login to Amazon AWS Console

    Login to Amazon AWS Console

  4. Create a new user here and keep the „Generate an access key for each user“ option activated.