Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I created an micro ec2 instance with free tier option. After using it a week, i realized that i need more memory. So, i thought of changing the instance type from micro to small(for which i have to pay per use).

I stopped the instance, changed its type from micro to small and restarted it.

After changing the instance type(to small), i got a new public DNS using which i can access my applications. But im not able to connect to the instance using WinSCP/Putty/Linux shell now. It says "Server refused our key" in windows, "Permission denied (publickey)" in linux.

Can any one help me out of this??

share|improve this question
    
I tried the same (stop, change type & restart) with an another instance. But with just the public DNS change i could access the instance from both SSH & browser. Its TOTALLY STRANGE. I ended up creating an another instance from scratch :( –  Karthik Jayapal Mar 29 '11 at 13:39
    
Check that the permissions on the contents of .ssh directory are correct. –  egorgry Mar 29 '11 at 16:40

3 Answers 3

It sounds as if the instance has reset to the Amazon-issued key when you created the instance.

You could try that to login.

share|improve this answer
    
That is what im trying with. I mean the instance still uses the same key when it was created. There can be only one key for an instance right? Can we change the key? –  Karthik Jayapal Mar 28 '11 at 9:18

When you create an instance there is an option to select one of your existing key pairs or create a new one. You, simply, have not selected the same key-pair for the small instance as applied to the micro.

Look at the two instances in the AWS dashboard, under the description tab you'll find the "Key Pair Name" field.

Unfortunately, you cannot change the the key pair of a running instance. You need to recreate the small instance and double check the key pair you use.

Otherwise, check what the new key pair and to obtain the public key, log into your account, go to Security Credentials and click on the Key Pairs tab.

If you don't have a copy of the private key, that cannot be recovered.

share|improve this answer

My problem resolved.. I was changing the permission of the ec2-user home directory so that it can be acccessed by other users..And it was causing the SSH to not to connect ! Once restoring the original permissions to ec2-user home directory , issue was resolved !

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.