How to access your EC2 instance via SSH only from specific IP-Addresses

Software Engineer at BMW, Oracle Certified Professional Java SE 11 Developer
Search for a command to run...

Software Engineer at BMW, Oracle Certified Professional Java SE 11 Developer
No comments yet. Be the first to comment.
Two whole days of my life, down the drain! Thankfully, it was just my pet project, but I ended up sacrificing an entire weekend wrestling with this enigma. So, I'm writing this blog post to save you from the same fate. Problem: I am using Quarkus and...

Shebang Shebang is a combination of bash # and bang ! followed the the bash shell path. Shebang is simply an absolute path to the bash interpreter. #! /bin/bash Make a file executable To make a .sh file executable only for your user, use: chmod u+x...

1. Show tables The command \dt stands for describe tables and shows all tables in the database, equivalent to show tables in MySQL. \dt 2. Create user Run the following SQL command to create a user. Replace and 'password' with the desired username a...

How to set JAVA_HOME on macOS Monterey? First check which shell you are using (either bash or zsh). For zsh shell, we can put the environment variables at ~/.zshenv or ~/.zshrc.echo $SHELL /bin/zsh On Mac OS X 10.5 or later, we can use /usr/libexe...

Fork your open source project you want to contribute into your GitHub and clone your fork. git clone git@github.com:dcnis/mockito.git Show current configured remote repositories. The origin repo points to your fork on GitHub. git remote -v > origin ...

In this article, we will learn how to create a Security Group, that enables SSH traffic through port 22 from a Managed Prefix List. The Managed Prefix List allows us to conveniently manage your public IP-addresses that can connect to our EC2 instance.
VPC and select Managed prefix lists. Create prefix listPrefix list name: IP-Whitelist for SSH accessMax entries: 10Address-family: IPv4Prefix list entries click Add new entryVPC and select Security groups. Security group name: SSHDescription: Allows SSH access from a managed prefix listVPC: Inbound rules click Add ruleType: SSH Source: CustomEC2 and select your EC2 instanceActions -> Security and click Change security groupsSSHNow you should be able to connect via SSH to your EC2 instance. Of course you also need a valid Key pair assigned to your EC2 instance and have the corresponding private key on your local machine or client.
EC2 and select your EC2 instance.Details -> Key pair assigned at launch you have a Key pair assigned and you have the corresponding Private Key (usually a .cer file) saved on your local machine. terminal and navigate to your Private Key cer file.EC2 instance with following commandssh -i privateKey.cer ubuntu@10.20.30.40
Replace the ip-address 10.20.30.40 with your Public ip-address of your EC2 instance and ubuntu with your user. In this article we learned how to create a Managed prefix list to simplify the process of adding and modifying IP addresses that are permitted to establish an SSH connection to our EC2 instance. We have also covered the steps involved in creating a Security Group and configuring an Inbound rule specifically designed to allow SSH access via Port 22 from our newly created Managed prefix list. By assigning this Security group to our EC2 instance, we have successfully established SSH connectivity, provided that we have a valid Key pair associated with our EC2 instance and have saved the corresponding Private Key on our local machine or client.