I used sudo chmod 744 / plz give me the solution

0

I used sudochmod 744 /. I know I'm stupid, but I want to change that authority back to 777. The root permission is annotated and cannot be accessed by root. Please tell me the solution.

saesig
asked 5 months ago194 views
1 Answer
0
Accepted Answer

Hello.

Stop the problematic EC2 and detach the root volume's EBS.
After that, attach EBS to the rescue EC2 and mount it.
You may be able to restore it by changing the permissions of the attach volume using the following command after mount it.
https://repost.aws/knowledge-center/ec2-linux-emergency-mode

sudo mkdir /mnt/rescue
sudo lsblk -f
sudo mount /dev/nvme1n1p1 /mnt/rescue -o nouuid
chmod 777 /mnt/rescue/

Please change "nvme1n1p1" to the device name confirmed by the "sudo lsblk -f" command.
After changing the permissions, detach EBS from the rescue EC2 and attach it to the original EC2.

profile picture
EXPERT
answered 5 months ago
profile pictureAWS
EXPERT
reviewed 5 months ago
  • Thank you for your reply. However, I proceeded as you said and ran the instance, but the instance was running and spewed a systemlog error.

    [ 96.900133] cloud-init[1986]: 2023-11-16 07:53:42,912 - url_helper.py[WARNING]: Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /latest/api/token (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5dd19d8ee0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"), UrlError("HTTPConnectionPool(host='fd00:ec2::254', port=80): Max retries exceeded with url: /latest/api/token (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5dd31d98e0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))")] during request to http://[fd00:ec2::254]:80/latest/api/token, raising last exception [ 96.971301] cloud-init[1986]: 2023-11-16 07:53:42,912 - url_helper.py[WARNING]: Calling 'None' failed [0/120s]: request error [HTTPConnectionPool(host='fd00:ec2::254', port=80): Max retries exceeded with url: /latest/api/token (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5dd31d98e0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))]

    Can you tell me why this error occurs?

  • It would be helpful if you could tell me exactly which steps you followed.
    There appears to be a problem with communication, such as a network interface. Please check whether the settings or permissions of the following files are correct.

    /etc/network/interfaces
    

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions