0

The company who used to manage our site has recently ceased business. They have given me the login details for our AWS account but I have so far been unable to access the SSH/FTP and I can no longer contact the company to get more information.

I am not hugely familiar with AWS, the extent of my knowledge is setting up one instance for a second company website on another account.

Can anyone help me figure out what the username is for the instance (I'm not sure even what OS is being used to try the default user), or if I can add another user through the AWS account. How I can create a new key pair to be able to login as well, I'm currently on Mac and I am used to using puttygen on Windows.

I apologise for not really having much information, I've been trying to gain access for a week now and I'm hoping someone will know better than me. Thank you

1
  • 1
    How would someone else know your settings and contracts better that you? Jun 16, 2017 at 17:36

3 Answers 3

1

Can anyone help me figure out what the username is for the instance (I'm not sure even what OS is being used to try the default user),

Short of brute-forcing, there's not much that can be done in this regard. Depending on the OS used, the default username could be one of [ubuntu, ec2-user, root], but those likely have been disabled.

or if I can add another user through the AWS account.

There is no easy way to do this.

How I can create a new key pair to be able to login as well

Creating a keypair is simple. Getting the public key onto the EC2 instance is the difficult part. Assuming that you have full privileges in the AWS account, you can recover from this, but it's not simple, especially for someone unfamiliar with AWS and Linux in general. Venturing into this on your own carries a risk of downtime and data loss, so be careful whatever you do.

I would recommend that you consider hiring someone for an hour or two to help you out - that's all it would take to recover from this. If you don't have ideas of someone locally that can help you, send me a note.

0

A few things to try:

  • You may not have access to the SSH port. Check the security groups and network ACLs allow SSH access from your IP. Inside the AWS console find VPC, then down the left there's security groups and Network ACLs (NACLs perhaps). Work out your public IP and add it in the format 1.2.3.4/32
  • If you can access the port, use the private key for certificate authentication, guessing the username from the list EEAA gave you. If you think it's a windows instance that's different again, you use a method like this.
  • Stop your instance (NOT terminate), start another, and mount the existing disk as a data disk. Migrate the data to the new instance. Details here.
0

A few more pointers

Regarding the "What's the OS" you can try to find the what is the OS of the original AMI which used to start your instance first time. Navigate to EC2 > instances > select your instance and check "AMI ID" note id and then try to find it in EC2 > AMIs > select "Public Images". If the image is public maybe it has the base distro in the "Platform" column.

The default user for ubuntu based is "ubuntu" the default user for amazon linux is "ec2-user" and "admin" for debian based images. Cent OS and other, I Don't know. SSH root user login is usually disabled by the OS.

Regarding the "Can I add another user to the instance" the answer is NO, a longer one will be "by default, using the console No".

For gain accessing to the user you can try either:

Create a new ssh key, make an AMI of the running machine and then launch a machine based in the AMI you took (without stopping the running one) but indicating that you want to use the new SSH key. The new instance should have the default user with the new key.

But if the running machine is too modified or it is impossible to know the default user you can take snapshots of the running disks and make new volumes and attach them to a new machine. Once the volumes are mounted you should gain access to the data, and you can rebuild the application from there.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .