You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

OCI Linux: Not Able Access Instance due to /etc Directory Permission Change (chmod -R 777 /etc)

Applies to:

Linux OS - Version Oracle Linux 7.9 and later
Linux x86-64

Symptoms:
/etc directory permission was accidentally changed to 777 by running command below and unable to access the instance now
# chmod -R 777 /etc/

Solution:

  1. Login to the server using single user mode
  2. Remount the root filesystem with read write option
    # mount -o remount,rw /
    # cd /etc
    Check the current permissions
    # ls -ltr
  3. Revert permission changes to default by following commands
    # rpm --setperms -a
    If files user and group ownership also changed then run
    # rpm --setugids -a
  4. Files which are not owned by any packages need to be corrected manually below to regain ssh access
Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!