Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-19-2011, 04:20 PM   #1
Registered: May 2011
Posts: 124

Rep: Reputation: 1
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?
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-19-2011, 04:43 PM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
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.
2 members found this post helpful.
Old 05-19-2011, 11:38 PM   #3
Registered: May 2011
Posts: 124

Original Poster
Rep: Reputation: 1
AlucardZero -
thanks so much, you heads-up was very valuable and I was able to fix my problem.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "sudo: Can't mkdir /var/run/sudo/%user%: File exists" CNBarnes Linux - Server 7 01-10-2011 05:11 PM
(Sudo) command can't run by sudo rahilmaknojia Linux - Server 8 06-25-2010 10:30 AM
changing the sudo password? SSJGoku Fedora 1 05-17-2009 07:04 PM
Unable to Run sudo due to getresuid() Not Working on CentOS 3.1 Xyrael Linux - Security 14 02-06-2008 09:29 PM
Unable to run /usr/sbin/pppd. --> Check permissions [solved] flosch Linux - Networking 0 05-05-2004 10:08 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:42 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration