
Choose Actions, Instance settings, Edit User Data.ĥ. Choose Instances from the navigation pane, and then select the instance you are trying to launch.Ĥ. It's a best practice to use an Elastic IP address instead of a public IP address when routing external traffic to your instance.Ģ. Stopping and starting the instance changes the public IP address of your instance.If your instance is part of an Auto Scaling group, temporarily remove the instance from the Auto Scaling group before starting the resolution steps. Instance termination in this scenario depends on the instance scale-in protection settings for your Auto Scaling group. Instances launched with Amazon EMR, AWS CloudFormation, or AWS Elastic Beanstalk might be part of an AWS Auto Scaling group. If your instance is part of an Amazon EC2 Auto Scaling group, then stopping the instance might terminate it.For more information, see Determine the root device type of your instance. If your instance is instance store-backed or has instance store volumes containing data, then the data is lost when the instance is stopped.Method 4: Use a user data script to repair SSH permissions and add the correct SSH public key to the authorized_keys file

For more information, see How can I use the AWSSupport-TroubleshootSSH Automation workflow to troubleshoot SSH connection issues? After installation, the tool checks for and corrects some issues that cause remote connection errors when connecting to a Linux machine through SSH. Method 3: Run the AWSSupport-TroubleshootSSH Automation procedureĪWSSupport-TroubleshootSSH installs the Amazon EC2Rescue tool. Change the user name according to your specific AMI. In this example, ec2-user is the user name. The following is an example of the ls -ld command and the resulting output.

Use the ls -ld command to make sure that the permissions of the files under the home directory are correct. For more information on Session Manager and a complete list of prerequisites, see Setting up Session Manager.ģ. Note: Installation of the SSM Agent is required to use this method. This method updates permissions and injects your SSH public key into the authorized_keys file. Method 2: Use AWS Systems Manager Session Manager to log in to the instance and make corrections Note: If you receive errors when running AWS CLI commands, make sure that you’re using the most recent version of the AWS CLI.

OHANAWARE PERMISSIONS RESET SERIAL
For information on configuring the EC2 Serial Console for Linux, see Configure access to the EC2 Serial Console. If your instance is unreachable and you haven’t configured access to the serial console, follow the instructions in Method 2, 3, or 4. Also, every instance using the serial console must include at least one password-based user. Then, create AWS Identity and Access Management (IAM) policies granting access to your IAM users. You can access the serial console using the Amazon EC2 console or the AWS Command Line Interface (AWS CLI).īefore using the serial console, grant access to it at the account level. The serial console connects to your instance without the need for a working network connection. The serial console helps you troubleshoot boot issues, network configuration, and SSH configuration issues. If you activated EC2 Serial Console for Linux, then you can use it to troubleshoot supported Nitro-based instance types. There are four methods for performing these tasks:
