• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Amazon AMI creation help, don't know pasword

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Amazon AMI creation help, don't know pasword

    OK, been trying today to get to grips with Amazon Web services with some degree of success. Don't really know much about online security and this may be the problem, but basically it is asking me for a passsword to get into my instance when I start it up.

    Here are my steps, I have tried to follow this site...

    http://docs.amazonwebservices.com/Am...sg/2006-06-26/

    I create my primary key with

    ec2-add-keypair gsg-keypair

    and save that file c:/key.txt, then I create my instance..

    ec2-run-instances ami-febd5897 -k gsg-keypair

    And I can see it runs OK with

    ec2-describe-instances

    I change my instances permissions to get access.

    ec2-authorize default -p 22
    ec2-authorize default -p 80

    Then I try to log in

    ssh -i c:/key.txt [email protected]

    but it asks me for "a passphrase for the key' which I do not have, then it asks me if I have the root password which I do not have as well.

    Does anyone know what I am doing wrong.

    Thanks

    #2
    That's a fairly old version of the docs; you may want to look at the latest version.

    Does your key file include the
    Code:
    -----BEGIN RSA PRIVATE KEY-----
    -----END RSA PRIVATE KEY-----
    lines around the key?

    Also, is this a Linux or a Windows AMI?

    Do you get a web page if you point your browser at http://ec2-175-129-139-170.compute-1.amazonaws.com/ ?

    What ssh client are you using? The -i switch is pretty much standard for Unix, but as you are apparently running on Windows, it's possible that your ssh client might use different switches, or might follow the Windows convention of using / instead of - for switches.

    Comment


      #3
      Thanks, had a look at that new documentation which is pretty much the same but it made the process a bit clearer.

      Got the lines round the file OK and it is a fedora AMI, when I connect to the HTTP:// I can see the apache splash page running OK.

      I am using "OpenSSH for Windows" which works as it says it would in the docs where I would have to narrow the permissions on the key file.

      Seems to be the last section when I try to log in..

      C:\Users\XXX>ssh -i C:\development\ec2\key.txt [email protected]
      Enter passphrase for key 'C:\development\ec2\key.txt':
      [email protected]'s password:
      Permission denied, please try again.
      [email protected]'s password:

      the passphrase takes a blank OK but don't know the root password.

      Thing is it never says anything about a root password in the linux docs.

      Comment


        #4
        You shouldn't need a root password - that's what the key file is for. Amazon strongly recommend disabling root login via password, and your AMI adheres to this recommendation.

        It seems that your key file isn't being presented to the server. Have you tried ssh --help to make sure the switch is correct?

        Also, I'm not sure why it's asking for a passphrase for the key file - my ssh doesn't do that (OS X, therefore BSD style Unix).

        You could try using PuTTY - it's a bit more convenient on Windows, what with having a GUI and all that. Amazon have an appendix explaining how to get it set up for AWS, in the documentation I linked to.
        Last edited by NickFitz; 31 December 2008, 12:41.

        Comment


          #5
          Cheers man, putty seemed to take it alright when I changed the key file over using PuttyGen, just asked for my username and I was in.

          I tried to login with the new key file using the command line and that still asked for password, been using g-eclipse and that also asks for a password.

          Now I just have to get the AMI on my machine and try and run it there so I can change it to my liking, but that's a job for next year.

          Cheers

          Comment

          Working...
          X