Remote SSH Access

If we have two servers, so if we want to connect server A to server B, the private key should be on server A, and server B should have the
public key.
Public key, that is, is written in an authorised file, and the private key is put in the SSH files.
So the private key has server A, and the public key has server B.
In server A, we navigate to the CD .ssh and create a key using the command ssh -keygen. We then confirm that the key is ready by entering yes.
Next, we move to server B and locate the public key. We navigate to the CD .ssh and find the file named authorised_keys. Inside, we find the public key that we generated on server A. We open the file in Vim and copy the key password. Then, we paste the copied key into server B using the same command.
Finally, we return to server A and type ssh -i id_ed25519 ubuntu@3.253.55.75. This command uses the specified private key file to connect to server A. After entering the username (ubuntu) and the server IP address (3.253.55.75), we are successfully connected to server B.
Subscribe to my newsletter
Read articles from AWSomeVikash directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

AWSomeVikash
AWSomeVikash
๐ Hi, I'm Vikash Patel โ a passionate AWS & DevOps enthusiast, sharing my complete learning journey and real-world implementations. ๐ On this blog, Iโm publishing a full DevOps + AWS roadmap โ from basics to advanced, covering: ๐ก AWS Services: EC2, S3, IAM, CloudWatch, Billing, and more ๐ง Linux commands & scripting โ๏ธ CI/CD pipelines with GitHub Actions & Jenkins ๐งฑ Infrastructure as Code using Terraform ๐ Monitoring, Alerts & Troubleshooting ๐ก Every post is beginner-friendly โ focused on clarity, practical use-cases, and hands-on solutions. ๐ Iโm also building my presence in the AWS Community, sharing what I learn, and learning from others. ๐ฑ Whether you're starting your cloud journey or looking for practical DevOps solutions, this blog is for you.