-4

I made a total mistake here. Anyway I ran chmod -R 777 /* and immediately regretted my decision.

I had to boot into single user mode to and ran chmod -R 755 /etc/* in order to login to the server.

The only problem is ssh now and obvious security issues.

How do I get SSH working again?

Lylo
  • 101

1 Answers1

-1

Couple of thoughts, assuming restore from backup is not an option:

  1. Check /home directory permissions. Everything underneath that should be 700 to make ssh happy (technically only required underneath your specific directory, but safer to just make that done across the board).

  2. Also make sure /root is 700.

  3. /tmp is special, you might want to do this: https://unix.stackexchange.com/questions/71622/what-are-common-rights-for-tmp-i-unintentionnally-set-it-all-public-recursive (not related to ssh particularly but just something that is not like other things you'll encounter).

  4. Consider installing a clean CentOS image somewhere and do the venerable stare and compare to get things back to normal. Or do it the easier way: https://superuser.com/questions/200681/how-to-display-only-permissions-and-file-names-using-ls-command - run on each image (yours and the new/clean one) and diff the outputs for any major anomalies.

Good luck!

-Mary

Mary
  • 595
  • 5
  • 11