Receiving "Permission denied (publickey)" or "Authentication failed, permission denied" errors when trying to access my EC2 instance. How do I resolve this?
If you receive "Permission denied (publickey)" or "Authentication failed, permission denied" errors when trying to access your EC2 instance, it may be because of the firewall on your computer. Check for any firewalls that are running and make sure they are not blocking access to the EC2 instance. As you've probably noticed, when trying to access my EC2 instance using Quickbooks after connecting to the Internet, you might receive one of these errors: "Permission denied (publickey)" or "Authentication failed, permission denied." This error is often caused by the self-signed SSL certificate that Amazon provides for me. One way around this problem is to use a different SSL certificate which doesn't present this problem. The other option is to re-enable the instance instead of shutting it down. If you are receiving an "Authentication failed, permission denied" error when trying to access your EC2 instance, this may be because you have not logged in using the SSH key provided by Amazon. If you are using Quickbooks Enterprise Cloud Edition or Quickbooks Enterprise Plus Cloud Edition, then you will need to log in with your AWS account credentials before trying to access your instance. The quick answer is that you are not being given permission to access your instance because you are not the owner of the instance. To correct this problem, please Contact us at QuickBooks Enterprise Support (855)756-1077.
Verify that the file permissions within the operating system are correct and that the correct SSH public key is in the authorized_keys file
Methods for performing these tasks:
Method 1: Use the EC2 Serial Console
If you activate EC2 Serial Console for Linux, then you can use it to troubleshoot supported Nitro-based instance types. The serial console helps you troubleshoot boot issues, network configuration, and SSH configuration issues. The serial console connects to your instance without the need for a working network connection. You can access the serial console using the Amazon EC2 console or the AWS Command Line Interface (AWS CLI) at QuickBooks Customer Service Number (855) 741-3663.
Before using the serial console, grant access to it at the account level. Then, create AWS Identity and Access Management (IAM) policies granting access to your IAM users. Also, every instance using the serial console must include at least one password-based user. If your instance is unreachable and you haven’t configured access to the serial console, follow the instructions in Method 2, 3, or 4. For information on configuring the EC2 Serial Console for Linux, see Configure access to the EC2 Serial Console.
Method 2: Use AWS Systems Manager Session Manager to log in to the instance and make corrections
This method updates permissions and injects your SSH public key into the authorized_keys file.
Note: Installation of the SSM Agent is required to use this method. For more information on Session Manager and a complete list of prerequisites, see Setting up Session Manager.
1. Open the AWS Systems Manager console.
2. Start a session.
3. Use the ls -ld command to make sure that the permissions of the files under the home directory are correct. The following is a list of the correct permissions:
Linux home directory, /home, for example, should be (0755/drwxr-xr-x).
User's home directory, /home/ec2-user/, for example, should be (0700/drwx------).
.ssh directory permission, /home/ec2-user/.ssh, for example, should be (0700/drwx------).
authorized_keys file permission, /home/ec2-user/.ssh/authorized_keys, for example, should be (0600/-rw-------).
The following is an example of the ls -ld command and the resulting output. In this example, ec2-user is the user name. Change the user name according to your specific AMI.
4. On your local computer, verify the SSH public key.
5. If the signature of the SSH public key isn't present in the output, then update the authorized_keys file to allow your SSH key. In the following example, replace the example key with your SSH public key.
7. End the session.
8. Connect to the instance using SSH.
Comments
Post a Comment