How to SSH from One Linux EC2 to another

Поділитися
Вставка
  • Опубліковано 28 жов 2024

КОМЕНТАРІ • 18

  • @UnusAWS
    @UnusAWS  Рік тому

    This video shows how you can SSH from one EC2 to another. It shows where to save your private key file in the originating EC2. Whether you need to use the same name as the keypair name or you can use a different name for the private key? Also, what should be the permission setting for the private key file.

  • @zahraelhaddi6980
    @zahraelhaddi6980 5 місяців тому +1

    thank you so much its great that you included the error and its dolution as well.

  • @ufuomaobodo8545
    @ufuomaobodo8545 Місяць тому +1

    Thanks for this

  • @swapnilpise6587
    @swapnilpise6587 Місяць тому +1

    thank you

  • @shyamprasad1363
    @shyamprasad1363 4 місяці тому +1

    Awesome.. Thanks for sharing...

  • @vipulsingh2846
    @vipulsingh2846 3 місяці тому +1

    nice explanation really helpful.

    • @UnusAWS
      @UnusAWS  14 днів тому

      Thank you for the feedback

  • @AdityaMoray-y9w
    @AdityaMoray-y9w 4 місяці тому +2

    Hi sir can't we directly ssh by changing settings in /etc/ssh/sshd_config and then use ssh-keygen and ssh-copy-id to login without password?

    • @UnusAWS
      @UnusAWS  4 місяці тому +1

      Thanks @AdityaMoray-y9w for bringing up this point. I will update this method as well in Video description.

    • @moforkevin
      @moforkevin Місяць тому

      mine says permission denied can you help ?

  • @prudvi6338
    @prudvi6338 6 місяців тому +1

    Thanks a lot sir

  • @AmishaSharma_1
    @AmishaSharma_1 Місяць тому

    When I'm trying to ssh, i am getting a promp for entering password, why?

  • @ajinkyayeole5574
    @ajinkyayeole5574 4 місяці тому

    Hi unus i need help about this I using office laptop for practice of aws. As I am using office laptop I not able to use cmd of laptop. But i can access Awa console through browser. How can i ssh to my rhel server from ubuntu with using cmd???

    • @UnusAWS
      @UnusAWS  4 місяці тому

      You can try the below from cloudshell. You can access cloudshell from the AWS console mainpage. Issue below commands to create keypair and launch EC2
      # Create keypair
      aws ec2 create-key-pair --key-name MyKeyPair --query 'KeyMaterial' --output text > MyKeyPair.pem
      # It creates the keypair MyKeyPair.pem in your cloudshell home directory.
      # change permissions
      chmod 400 MyKeyPair.pem
      #Find a Ubuntu or RHEL image from EC2 launch page.
      ex: ami-0583d8c7a9c35822c
      # Create EC2 with the above AMI + above keypair.
      aws ec2 run-instances --image-id ami-0583d8c7a9c35822c --count 1 --instance-type t2.micro --key-name MyKeyPair --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=MyRHELInstance}]'
      # Now, you can SSH from cloudshell to your EC2. Use the connection string under EC2 console > Select instance > Click on Connect > SSH client > connection string under 'Example'

  • @kidistamosa9084
    @kidistamosa9084 Рік тому +1

    Thank you !

  • @ajinkyayeole5574
    @ajinkyayeole5574 4 місяці тому

    Can we do this without CMD...

  • @shyamprasad795
    @shyamprasad795 7 місяців тому

    How to do this for windows machines?

    • @UnusAWS
      @UnusAWS  7 місяців тому

      You could refer to these docs which talks about this topic:
      docs.aws.amazon.com/AWSEC2/latest/UserGuide/openssh.html
      docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/connecting_to_windows_instance.html