How to SSH from one Linux EC2 instance to another

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ก.พ. 2025

ความคิดเห็น • 144

  • @rameshselva4812
    @rameshselva4812 3 ปีที่แล้ว +2

    Ohhh. Thank you so much namrata. This is what exactly my trainer gave us as a task. He taught with windows servers and gave task in Linux. And I executed successfully from this video. Thank you so much once again.

  • @gerried1218
    @gerried1218 3 ปีที่แล้ว +1

    I have been working on this for the past 6 hours and everywhere I checked did not give me the solution. This is the best solution so far. Thanks very much

  • @sahithipondugula8316
    @sahithipondugula8316 4 ปีที่แล้ว +1

    Thanks alot Namrata!! I was trying this for almost 4 hrs and now finally did!

  • @178pal
    @178pal 5 ปีที่แล้ว +3

    Awesome.. well explained.. I was stuck at this point for more than 3 hours.. Thanks

  • @shankavaramanagha9672
    @shankavaramanagha9672 4 ปีที่แล้ว +1

    Hi Namrata, This is the second time, I have benefitted by watching your video. Thanks a lot! Keep the good work going --- Regards Prashant

  • @razaaws
    @razaaws 4 หลายเดือนก่อน +1

    Thanks you so much for this very simple and clear explanation

  • @rishisharma6246
    @rishisharma6246 4 ปีที่แล้ว +1

    Thank you so much... Stuck on this from 2 days.. Thank you so much..🙏

  • @rigobertndifon7518
    @rigobertndifon7518 4 ปีที่แล้ว +1

    wonderfully demonstrated.Thank you NamrataHSHah

  • @willcalde
    @willcalde 2 ปีที่แล้ว

    Thank you so much namrata, you are my hero :)

  • @kaykann7880
    @kaykann7880 5 ปีที่แล้ว +1

    Well explained. Thanks Namrata baji

  • @harrysingh6163
    @harrysingh6163 2 ปีที่แล้ว +1

    I appreciate the job, great video. Done the job in one go.

  • @ashrafshaik8051
    @ashrafshaik8051 5 ปีที่แล้ว +1

    A very heartful thanks Namrata
    It's very helpful to me

  • @sridharreddy2876
    @sridharreddy2876 3 ปีที่แล้ว +1

    Hi Namrata, thanks for your video Its helped me a lot to understand this issue and resolved for me.

  • @jitendrasena1263
    @jitendrasena1263 5 ปีที่แล้ว +1

    Thanks Namrata Mam.....i was needed it

  • @VigilanteMian
    @VigilanteMian 4 ปีที่แล้ว +1

    Very nicely explained, Namrata.

  • @RahulSingh-sn3er
    @RahulSingh-sn3er 5 ปีที่แล้ว +1

    TNX for making such imp video, its really very helpful ....

  • @vishnu-i8l
    @vishnu-i8l 6 หลายเดือนก่อน +1

    Nice video and it is a understandable way

  • @yanonirmal
    @yanonirmal 10 หลายเดือนก่อน

    Thankyou so much for the video well explained !!!

  • @dhineshprabakaran1786
    @dhineshprabakaran1786 4 ปีที่แล้ว +1

    Thanks for this valuable sharing. Please continue sharing :-)

  • @pullareddykotla9836
    @pullareddykotla9836 5 ปีที่แล้ว +2

    Thank you for making nice video and easly grabed it.

  • @ranjithkumar2034
    @ranjithkumar2034 4 ปีที่แล้ว +1

    Nice info ,, keep doing great work

  • @rfrancoi
    @rfrancoi 5 ปีที่แล้ว +1

    Thank you for your hard work. Very much appreciated.

  • @kartheekbankapalli8437
    @kartheekbankapalli8437 ปีที่แล้ว

    Thankyou so much..my doubt clear..❤

  • @rajrajendran410
    @rajrajendran410 4 ปีที่แล้ว +1

    Thank you so much ,it was very helpful for me , you taught easy way.

  • @edsonsilva8397
    @edsonsilva8397 3 ปีที่แล้ว +1

    Thank you very much!!
    You helped me a lot!

  • @jaanvaan1468
    @jaanvaan1468 4 ปีที่แล้ว +1

    I tried same for 2 centos machines in AWS ....but is asking for pem password...But , I haven't set any password for pem file

  • @TheKartik555
    @TheKartik555 6 ปีที่แล้ว +1

    Hi Namrata thanks for sharing the knowledge it worked, It would be helpful if you can explain on command functionalities as well.

    • @NamrataHShah
      @NamrataHShah  6 ปีที่แล้ว +1

      Kindly elaborate of command functionalities. I have a few videos on CLI check them out

  • @juigajjar8672
    @juigajjar8672 4 ปีที่แล้ว +1

    It was a great help

  • @supersaiyan3704
    @supersaiyan3704 4 ปีที่แล้ว +1

    Thank you so much mam. It worked like a charm

  • @AdityaMoray-y9w
    @AdityaMoray-y9w 7 หลายเดือนก่อน +1

    Hi thank you for the video.Can you SSH without the keypair?

  • @sivaramanr7781
    @sivaramanr7781 3 ปีที่แล้ว +1

    Thank you very much, it's really useful

  • @zalakbensureshkumarprajapa1060
    @zalakbensureshkumarprajapa1060 3 ปีที่แล้ว +1

    How do I Configure "authorized_keys" for an ssh server and "known_hosts" for an ssh client on each VM instance to allow passphraseless ssh login between two instance.

  • @TheEternalBlizzard
    @TheEternalBlizzard 2 ปีที่แล้ว

    Can we use it to connect from one instance to another if both are located in *Different Regions* ?! Please confirm. Thanks!

  • @dhwanishah4093
    @dhwanishah4093 2 ปีที่แล้ว

    Hi Namrata,
    Why second time putty asked about Enter passphrase for key"", How to solve that?

  • @mahendrarajgude4070
    @mahendrarajgude4070 5 ปีที่แล้ว +1

    Useful video. Thanks

  • @famss786
    @famss786 3 ปีที่แล้ว +1

    Thanks - great videoes

  • @kaykann7880
    @kaykann7880 5 ปีที่แล้ว

    Hello namrata baji. Problem with ssh to linux ec2c. using putty pageant. my pc-->internet-->ec2-a public(ssh-ok)--->ec2-b private(ssh-ok)----vpc peering----ec2-c private(ssh-access-denied-publickey issue). inbound SG ssh port 22 open for ec2-c. vpc peering active and I can ping to ec2-c. all pkk uploaded to pageant and using check mark "agent forward" in putty. any idea?

  • @DavidBenOtto
    @DavidBenOtto ปีที่แล้ว

    but what if the target has the public IP address? Should the process be the same?

  • @vamsikrishna2330
    @vamsikrishna2330 5 ปีที่แล้ว +1

    Thanks much.. this helped a lot

  • @phoenix281287
    @phoenix281287 2 ปีที่แล้ว

    @NamrataHShah: Will these steps work if I try to SSH from one linux EC2 instance to another in a different VPC?

  • @shubhamrendalkar6791
    @shubhamrendalkar6791 3 ปีที่แล้ว

    I have connected as u shown bt not able to copy files. Please help me with this issue

  • @tmaiswarya9699
    @tmaiswarya9699 3 ปีที่แล้ว

    Hi mam,,I got a question in AWS,in my company two developers (developer A and developer B) they have two instance(instance A and instance B) , developer A can access only instance A and developer B can access only instance B,

  • @nagarajuboddupally-bw8gw
    @nagarajuboddupally-bw8gw 10 หลายเดือนก่อน

    hi in target server how can u create without public key. its confused me
    i connected same i followed ur vedio, i got permission denied i given the chmos 600 filename but it showing same source server only. not connecting to target server

  • @sivaramakrishnans4133
    @sivaramakrishnans4133 3 ปีที่แล้ว +1

    thanq mam u saved me

  • @adeelshamas3337
    @adeelshamas3337 3 ปีที่แล้ว

    I downloaded the .ppk key used putty to ssh into the source ec2, but can I get .pem file?

  • @balivadasairaghavahemanth1466
    @balivadasairaghavahemanth1466 3 ปีที่แล้ว

    is this about Connecting private instance with public instance in EC2 linux ??

  • @sushilmusande9208
    @sushilmusande9208 3 ปีที่แล้ว

    Hello Namratah,
    Is there any way to connect to target if i lose/replace the source machine aws key?
    I replaced key of source machine and now i'm not able to ssh to target?
    Thanking you in advance for your suggestion/Help.😊

  • @CoolBishop1997
    @CoolBishop1997 4 ปีที่แล้ว +1

    very nice tutorial

  • @vlsi227
    @vlsi227 5 ปีที่แล้ว +1

    Hi Namrata Thanks very much for sharing this valuable knowledge. I'm unable connect public ec2 to other private ec2. Can you Give details and how you connected the subnets in two servers.

    • @NamrataHShah
      @NamrataHShah  5 ปีที่แล้ว +1

      If the subnets are in the same vpc then there is trust established already if not then u need to perform vpc peering and establish trust

  • @arig2519
    @arig2519 5 ปีที่แล้ว +1

    Good one

  • @SohailKhan-qk4gl
    @SohailKhan-qk4gl 3 ปีที่แล้ว

    Hi. Why doesn't your target machine have a public IP address?

  • @sushmitha156
    @sushmitha156 6 ปีที่แล้ว +1

    Hi Namratha can you please show how to ssh 2 instaces of different vpc

    • @NamrataHShah
      @NamrataHShah  6 ปีที่แล้ว +1

      Methodology is the same as long as the VPCs are peered. Refer to my VPC peering videos.

  • @shaikaslam6963
    @shaikaslam6963 4 ปีที่แล้ว +2

    Hi Namrata, I have followed all the steps as you have shown in this video, but at last part after changing the file permission to 600, I'm still getting the permission denied error as below
    Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
    Could you please assist me on the same?
    Thanks

  • @Noses.
    @Noses. 4 ปีที่แล้ว

    Can uses this to log from aws linux to another centos 7 server at home

  • @sanketshahane178
    @sanketshahane178 5 ปีที่แล้ว +1

    thank u mam for this tutorial..

  • @aswiniravella8037
    @aswiniravella8037 4 ปีที่แล้ว +1

    ma'am why we don't have public IP into the target machine.

    • @NamrataHShah
      @NamrataHShah  4 ปีที่แล้ว

      Think and let me know ...

  • @sunilchaudhari5248
    @sunilchaudhari5248 4 ปีที่แล้ว

    can u explain if how we can share public key with private instance & connect using public key instead of private key(.pem)?

  • @AmanSingh-xi3xl
    @AmanSingh-xi3xl 3 ปีที่แล้ว

    Thanks Namrata- what was the command you used after you connected to the private server from public ? and you created a file in the target server ?

  • @chandureddim4327
    @chandureddim4327 4 ปีที่แล้ว

    mam, where to learn these commands and what are these commands
    are these ssh commands or linux commands
    the same steps are worked for ubuntu to..
    please reply me mam what are these commands
    thank you..
    and i just felt got saved from corona mam.thank you..for this mam.

  • @pauleingrid
    @pauleingrid 4 ปีที่แล้ว

    Is it possible to create 3 instances and deploy on each(database, nodeJs, ANgularjs) and then conect the three of them?

  • @kingstanm8671
    @kingstanm8671 5 ปีที่แล้ว +1

    cheers ka, it is quite simple. thanks.
    peace.

  • @harshith8227
    @harshith8227 4 ปีที่แล้ว +1

    Is there any direct way to connect our second instance with the same keypair as first without using that command ??

  • @shivananduppar1130
    @shivananduppar1130 4 ปีที่แล้ว

    How to change the private key? If it's exposed to somebody. Can you explain it for us?

  • @sujalmitra5328
    @sujalmitra5328 5 ปีที่แล้ว +1

    Please share the process to change the permission of the pem file

    • @NamrataHShah
      @NamrataHShah  5 ปีที่แล้ว

      on linux it is a command --> chmod

  • @GovindCLT
    @GovindCLT 5 ปีที่แล้ว +1

    Thanks, this is working for me with ec2-user. I have postgres user and trying to do the same way, but errors out. Can you please help me here?

    • @NamrataHShah
      @NamrataHShah  5 ปีที่แล้ว

      This method is for AWS EC2 communication ..

  • @mohammedrizwan5359
    @mohammedrizwan5359 2 ปีที่แล้ว

    Awsome thank you so much

  • @pidugunagendra8683
    @pidugunagendra8683 3 ปีที่แล้ว

    Hi madam will you help me how to provisioning afp2pdf automation server in aws

  • @D3D3-phoenix
    @D3D3-phoenix 5 ปีที่แล้ว +3

    Very simple steps...unfortunately I got "Permission denied (publickey)" as an error message. I followed the steps

    • @cyliaselloum8001
      @cyliaselloum8001 4 ปีที่แล้ว +1

      I.O Awani-Mayaki the same error for me

    • @jobethagulan8645
      @jobethagulan8645 4 ปีที่แล้ว +1

      change the chmod option to 400

    • @shaikaslam6963
      @shaikaslam6963 4 ปีที่แล้ว

      @@jobethagulan8645 Hi Jobeth, tried changing the file permission to 400, but still, I'm getting the same error as below
      Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

  • @vipinm655
    @vipinm655 2 ปีที่แล้ว

    MAM,I TRIED TO SSH,BUT ALL TIME IT ASKING FOR PASSPHRASE KEY EVEN I DONT ADDED THE PASSPHRASE ,KINDLY HELP ME

  • @phaniindra6040
    @phaniindra6040 5 ปีที่แล้ว +1

    so after doing this can I add these servers into our ansible hosts inventory and run playbook to install any application ?

    • @NamrataHShah
      @NamrataHShah  5 ปีที่แล้ว

      You will need to add the code to login as a part of your script.

    • @MuhammadFadhil-wq2te
      @MuhammadFadhil-wq2te 5 ปีที่แล้ว +2

      yes you can, simply edit /etc/ansible/hosts
      [Group-Name]
      ansible_user= ansible_ssh_private_key_file=

  • @ShahidulIslamShubo
    @ShahidulIslamShubo 5 ปีที่แล้ว

    hlw
    i got a problem there are show this message
    Enter passphrase for key 'newfile':
    how can i get the passphrase for key
    Please help me

  • @arpangupta2162
    @arpangupta2162 3 ปีที่แล้ว

    why targetlinuxec2 machine doesn't have public ip address

  • @jpnaidu1
    @jpnaidu1 4 ปีที่แล้ว

    Here we are able to connect to Private ip and what what about if we need to connect to public ip?

    • @jpnaidu1
      @jpnaidu1 4 ปีที่แล้ว +1

      I got answer thx

    • @anubhavs103
      @anubhavs103 3 ปีที่แล้ว

      @@jpnaidu1 how bro am connecting through public ip and throwing the error permission denied

  • @balajimuthukali7487
    @balajimuthukali7487 2 ปีที่แล้ว +1

    Thanks mam

  • @Techvlogs852
    @Techvlogs852 6 ปีที่แล้ว +1

    can you make video on aws route53

    • @NamrataHShah
      @NamrataHShah  6 ปีที่แล้ว

      Will try ... I don't have a registered domain name.

  • @ashrafshaik8051
    @ashrafshaik8051 4 ปีที่แล้ว

    Hi Madam could you please explain using git bash also.. with out pemfile

  • @mohdazhar1787
    @mohdazhar1787 5 ปีที่แล้ว

    in nano editor of linux instance pem key is not pasting from notepad how to paste it commands ctrl +v is not working in nano

    • @NamrataHShah
      @NamrataHShah  5 ปีที่แล้ว

      Hit enter or Ctrl U ... Ctrl V is for windows

  • @TheSimpleUrbanLife
    @TheSimpleUrbanLife 4 ปีที่แล้ว

    Hello Namrata!
    I did follow the steps and when I try to do ssh from my master with client private IP, it asks me for the password of the client and I don't remember it. Can you please help me with that?

    • @NamrataHShah
      @NamrataHShah  4 ปีที่แล้ว

      I don't know your password.

  • @sainath691
    @sainath691 3 ปีที่แล้ว +1

    Thanks you

  • @nihalshetty6073
    @nihalshetty6073 5 ปีที่แล้ว

    I am getting connection timeout error when I try to do the same.I did change the permission of the file as well ,but still getting the same error.Kindly suggest

    • @NamrataHShah
      @NamrataHShah  5 ปีที่แล้ว

      It is facing issues to connect .. check IP, credentials, security group settings esp. port 22 should be open and the source security group (if different) should have access and check your key.

    • @rashmiraoraghavendra105
      @rashmiraoraghavendra105 5 ปีที่แล้ว

      Hi Nihal
      I also faced the same error.
      Were you able to fix it?
      If Yes, Can you please let me know what was the issue?

  • @Krishiv11
    @Krishiv11 5 ปีที่แล้ว

    how to do SSH if both instance having different "Key pair"- file name ?

    • @NamrataHShah
      @NamrataHShah  5 ปีที่แล้ว

      Name does not matter as long as the key pair is the same

  • @AmCoolBuddy
    @AmCoolBuddy 5 ปีที่แล้ว

    well. it is working as normal user. But, it is refusing when i am trying as root user
    error like "Please login as the user "ec2-user" rather than the user "root" "
    Can you help me please ?

    • @NamrataHShah
      @NamrataHShah  5 ปีที่แล้ว

      To login into ec2 you need to use ec2-user that is the default. You can switch to the root user after you have successfully logged in and need to perform activities of a root user.

    • @AmCoolBuddy
      @AmCoolBuddy 5 ปีที่แล้ว +1

      @@NamrataHShah @NamrataHShah Thank you for your reply. I have copied the root pub key in the target node and enable public key access then it works. Actually l am setupin chef infra. So it's required direct root acces to deploy a cookbook. Now its fixed. Really I would like to apprentice your video. It was very useful in the beginnings.

  • @abhishekbhandari6477
    @abhishekbhandari6477 5 ปีที่แล้ว

    hi there . When i do this it is asking me for the passphrase?????

    • @NamrataHShah
      @NamrataHShah  5 ปีที่แล้ว

      If you create your key with passphrase then you will need to provide it. See if you create a key without the passphrase.

    • @abhishekbhandari6477
      @abhishekbhandari6477 5 ปีที่แล้ว +1

      I got it the pem file was corrupted. I.e it was not copied properly

  • @niteshchidrawar6553
    @niteshchidrawar6553 5 ปีที่แล้ว

    permission denied (publickey gssapi-keyex gssapi-with-mic) i tried everything but got this error

    • @cragdoo71
      @cragdoo71 5 ปีที่แล้ว +1

      chmod 600

  • @dhruvsahu726
    @dhruvsahu726 5 ปีที่แล้ว +1

    It's great

  • @kingstanm8671
    @kingstanm8671 5 ปีที่แล้ว

    btw, how for passcode less authentication between two amz ec2?
    please explain.

    • @NamrataHShah
      @NamrataHShah  5 ปีที่แล้ว

      Kindly elaborate more

    • @kingstanm8671
      @kingstanm8671 5 ปีที่แล้ว

      @@NamrataHShah If i need passcode less ssh session between two ec2 (for ansible yaml to work) how i can proceed? please assist.
      i just copied the pub key to the authorised key file and it worked.
      I want to know if any more methods are there?
      peace

  • @bodob280
    @bodob280 4 ปีที่แล้ว +1

    thank you

  • @baludev3242
    @baludev3242 5 ปีที่แล้ว

    I'm unable to connect, I don't know why .. I followed your steps .. still not able to connect

    • @NamrataHShah
      @NamrataHShah  5 ปีที่แล้ว

      Debug it … You might have missed something

  • @fbsoul1
    @fbsoul1 4 ปีที่แล้ว +1

    thanks

  • @darabahmadkhan7250
    @darabahmadkhan7250 4 ปีที่แล้ว

    Mam your voice is not clearly audible plss be bit loud that we can understand words more clearly

    • @NamrataHShah
      @NamrataHShah  4 ปีที่แล้ว

      I believe the voice is loud and clear. Try and increase your volume.

  • @dhruvsahu726
    @dhruvsahu726 5 ปีที่แล้ว +1

    You are a problem solver please post your coarse on udemy of aws

  • @goldentouch7308
    @goldentouch7308 2 ปีที่แล้ว +1

    Thank you

  • @meghamohan799
    @meghamohan799 2 ปีที่แล้ว

    Thankyou