Unable to run 'su' and 'sudo' after changing permissions on /etc
I'm running rhel6 64bit. Accidentally I ran % chmod -R 777 /etc and after that I have a problem to do 'su' or 'sudo'. When I did sudo it complained that /etc/sudoers has 777 while it should be 0440. I changed that and also restored right permission for:
-rw-r--r-- 1 root root 1966 May 19 13:41 /etc/passwd
-r-------- 1 root root 1161 May 19 13:42 /etc/shadow
-r--r----- 1 root root 3746 Apr 23 01:38 /etc/sudoers
Anyway it failed to 'su'. Then I restored back permissions on files in /etc/security and /etc/sysconfig. Still can't do 'su'. Note: I could login from console as root but can't 'su' or 'sudo'.
when I do 'su' it gives error:
su: incorrect password
Could someone help with it?
There are probably clues in /var/log/messages or /var/log/secure.
I bet it's the files in /etc/pam.d/.
Also SSH will need /etc/ssh/* permissions fixed.
thanks so much, you heads-up was very valuable and I was able to fix my problem.
|All times are GMT -5. The time now is 01:40 AM.|