0
Uncategorized

Step 1: Create a Bastion Host (also known as jump server)  in a public subnet and Database server in a private subnet. Do SSH into the Bastion host.

Step2: Load the key: To connect with the private (database) Server, we need the key to be present in the bastion host. For the same, we will create the private key in Bastion host.

Linux Commands:

Connect as a root user:

 Sudo su
Create a file with the same name as your key for private(databse)server:

# touch <privatekeyname.pem>

Open the newly created key with vim editor:

#vi <privatekeyname.pem>          

Copy paste the text from your original key to this new key: 

Paste, save and  exit: press Escape then   :wq

This will save the text and you will be exit from the editor.

Step3: Change the access permissions for the newly created key

Linux Commands:

#chmod 400 <privatekeyname.pem>  

Chmod is used to change the permissions of the file.

Step 4: SSH into the database server.

Linux Command:

#ssh -i “newprivate.pem” ec2-user@10.0.23.80

Newprivate.pem is the newly created key.

Ec2-user is the username to connect

10.0.23.80 is the private IP of the database server.

Final Connection:

Thus SSH successfully into the database server from the Bastion host.

** Pinging any website will not work as the database server is not connected to the internet.

Click to download pdf.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts