Day 11: SSH Overview 🛡and Using SSH with Windows and Linux/Mac⚙

ShaileshShailesh
3 min read

In this blog post, we'll cover the basics of SSH (Secure Shell), how to use SSH with Windows, and how to use SSH with Linux/Mac. By the end of this post, you'll understand SSH and how to use it to securely connect to EC2 instances.

SSH Overview🛡

SSH (Secure Shell) is a cryptographic network protocol 📡used to securely access and manage remote computers over an unsecured network. It provides a secure channel over an unsecured network by using a pair of cryptographic keys for authentication and encrypted communication. SSH is commonly used for:

  • Secure remote login to servers

  • Secure file transfers using SCP (Secure Copy) and SFTP (SSH File Transfer Protocol)

  • Secure command execution on remote machines

Key components of SSH include:

  • SSH Client: A software that uses the SSH protocol to connect to a remote server.💻

  • SSH Server: A software that runs on a remote machine and accepts SSH connections.🖥

  • SSH Keys: A pair of cryptographic keys (public and private) used for authentication.🔑

SSH with Windows🪟 and Linux🐧/Mac🍎

SSH with Windows🪟

Using PuTTY🔌

PuTTY is a popular SSH client for Windows. Here’s how to use it:

  1. Download PuTTY:

    • Go to the PuTTY website and download the PuTTY installer for Windows.

    • Install PuTTY on your computer.

  2. Obtain Your EC2 Key Pair:

    • Ensure you have the .pem file for your EC2 instance key pair.
  3. Convert .pem to .ppk:

    • Open PuTTYgen (installed with PuTTY).

    • Click "Load" and select your .pem file.

    • Click "Save private key" to save the .ppk file.

  4. Connect to EC2 Instance:

    • Open PuTTY.

    • In the "Host Name" field, enter ec2-user@your_instance_public_ip.

    • In the "Category" pane, go to "Connection > SSH > Auth".

    • Browse and select your .ppk file.

    • Click "Open" to connect.

Using Windows 10 🪟Built-in SSH

Windows 10 has a built-in SSH client. Here’s how to use it:

  1. Open PowerShell:

    • Press Windows + X and select "Windows PowerShell".
  2. Connect to EC2 Instance:

    • Use the following command:

        bashCopy codessh -i path_to_your_pem_file.pem ec2-user@your_instance_public_ip
      
    • Replace path_to_your_pem_file.pem with the path to your key pair file and your_instance_public_ip with the public IP of your EC2 instance.

SSH with Linux🐧/Mac🍎

Linux and MacOS have built-in SSH clients. Here’s how to use them:

  1. Open Terminal:

    • On Linux, press Ctrl + Alt + T or search for "Terminal" in the applications menu.

    • On MacOS, press Command + Space and type "Terminal".

  2. Connect to EC2 Instance:

    • Use the following command:

        bashCopy codessh -i path_to_your_pem_file.pem ec2-user@your_instance_public_ip
      
    • Replace path_to_your_pem_file.pem with the path to your key pair file and your_instance_public_ip with the public IP of your EC2 instance.

Tips for Using SSH✔

  • Keep Your Private Key Secure: Never share your private key and keep it in a secure location.

  • Use Strong Key Pairs: Generate strong key pairs to enhance security.

  • Regularly Rotate Keys: Regularly rotate your SSH keys to mitigate the risk of key compromise.

  • Use SSH Agent: Use an SSH agent to manage your keys and simplify the login process.

Conclusion💡

SSH is a vital tool for securely managing remote servers. In this guide, we covered the basics of SSH, how to use SSH with Windows using PuTTY and the built-in SSH client, and how to use SSH with Linux and MacOS. By following these steps, we can securely connect to your EC2 instances and manage them effectively.

I hope this detailed guide helps you get insights of SSH. Stay tuned for more AWS insights!!⚜ If you found this blog helpful, share it with your network! 🌐😊

Happy cloud computing! ☁️🚀

0
Subscribe to my newsletter

Read articles from Shailesh directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shailesh
Shailesh

As a Solution Architect, I am responsible for designing and implementing scalable, secure, and efficient IT solutions. My key responsibilities include: 🔸Analysing business requirements and translating them into technical solutions. 🔸Developing comprehensive architectural plans to meet organizational goals. 🔸Ensuring seamless integration of new technologies with existing systems. 🔸Overseeing the implementation of projects to ensure alignment with design. 🔸Providing technical leadership and guidance to development teams. 🔸Conducting performance assessments and optimizing solutions for efficiency. 🔸Maintaining a keen focus on security, compliance, and best practices. Actively exploring new technologies and continuously refining strategies to drive innovation and excellence.