0

We are hosted in AWS EC2 instance, I was installing SSL certificate for our codeigniter php based website. I was unable to upload the files in /etc/ssl/certs/ to get the access i wrote some code.

sudo usermod -a -G ubuntu www-data
sudo setfacl -R -m u:ubuntu:rwx /var/www/html
sudo setfacl -R -m u:ubuntu:rwx /etc

After this users are blocked and not logging in, I have no idea how to recover this, hot to revert the changes? as i'm not able to login. and also how to get permissions for /etc.

  • 2
    Contact AWS customer service. If you can't login or otherwise access the instance's filesystem, there's nothing we can do to help. – muru Oct 23 '18 at 4:18
  • 2
    In general it's never a good idea to change permissions for system directories, such as /etc. – vidarlo Oct 23 '18 at 4:46
  • Actually i want to know what happened after writing these codes, and how can i copy the ssl certificate into '/etc'. – Mlam Oct 23 '18 at 5:02
1

Some VPS providers allow 'console' access, which is the only way to recover from this kind of permissions mistake. Try contacting AWS to ask if they support this, or if they can roll your VPS instance back to a previous snapshot. I don't believe AWS supports either of these options so this may not be something you can recover from, and you'll need to start over with a new instance instead.

Actually i want to know what happened after writing these codes, and how can i copy the ssl certificate into '/etc'. (from comments)

For future reference, a better way to copy those files to protected directories is to scp them to your (non-root) user's home from your local machine, then move them with sudo privileges on the server sudo mv ~/file /etc/destination.

AWS is great but it is not very forgiving if you are still learning, and you might be better off at a different provider that offers more recovery options.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.