Home > Mobile >  Amazon EC2 instance connect
Amazon EC2 instance connect

Time:04-29

This is the configuration on my Amazon EC2 Free Tier instance.

The issue is that I am not able to access my WordPress data. Example: wp-config.php, upload folder, etc

There are 4 ways available to connect with the instance:

  1. EC2 Instance Connect - It is not working because the platform is Debian (It works for Linux2 and Ubuntu absolutely fine. I tried by launching a new Ubuntu instance.)
  2. Session Manager - Session manage is not installed
  3. SSH client - No matter how I create the key, pem, ppk or whatever, it always gives me an error that key is public.
  4. EC2 Serial Console - It is only available for Nitro based instances so changed the instance type from t2.micro to t3.micro

Apart from I also have access to AWS Cloud Shell but I couldn't find WordPress files there.

How can I access (create/edit/delete) files on my AWS EC2 Debian Instance?

CodePudding user response:

Before you connect to your Debian / Wordpress instance, verify (again and carefully) the following general prerequisites:

  • Get the ID of the instance.
  • Get the public DNS name of the instance.
  • Get the user name for your instance.
For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.
For a CentOS AMI, the user name is centos or ec2-user.
For a Debian AMI, the user name is admin.
For a Fedora AMI, the user name is fedora or ec2-user.
For a RHEL AMI, the user name is ec2-user or root.
For a SUSE AMI, the user name is ec2-user or root.
For an Ubuntu AMI, the user name is ubuntu.
For an Oracle AMI, the user name is ec2-user.
For a Bitnami AMI, the user name is bitnami.
Otherwise, check with the AMI provider. --> Yours is bitnami.

If you have a custom user, check this

  • Enable inbound SSH traffic from your IP address to your instance.

NOTE: Ensure that the security group associated with your instance allows incoming SSH traffic from your IP address. The default security group for the VPC does not allow incoming SSH traffic by default.

Connect to your Linux instance using SSH

  • Locate the private key
  • Set the permissions of your private key with the following:
chmod 400 my-key-pair.pem

The last step is especially important, as you say that you get public key error. More on this here.

  • Related