![]() 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. ![]() $ sudo chmod 600 /home/ec2-user/.ssh/authorized_keys $ sudo chmod 700 /home/ec2-user /home/ec2-user/.ssh $ sudo chown ec2-user:ec2-user /home/ec2-user -R To correct permissions, run the following commands on your EC2 instance. $ echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVogCW5eZogRp+vF6Ut360b0bYyTmqgYaCXOyiW77I916AS5jF元zsCtONbGn4hnG/UGGWXpLfUV85qpVJb38fskPZNuyZtjGjXM2W7qqbCZ1N9HBb6IPBaL97tmqBi+8rD7mSkoHc40sIV+KxkQSvD6AAFjQruCjxzfGIApnOvuj6IMsVEuFHBx4QhkbCzafxo02D9BZT4+dMy7tmyuC+UiNEQpgfFoszl+4VNFTIPlQQyn6CpUiV/rFXIadXsHqc+UOdVnfEXP+30YL75RHabze/1F5MY6t94AEcmcb05Dq4vwN9IjcxKmwgvxLOXzryytepvHQU+PobBEXAMPLE' > /home/ec2-user/.ssh/authorized_keysĦ. In the following example, replace the example key with your SSH public key. 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. On your local computer, verify the SSH public key.ĥ. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |