Unable to run 'su' and 'sudo' after changing permissions on /etc


 
Thread Tools Search this Thread
Special Forums Cybersecurity Unable to run 'su' and 'sudo' after changing permissions on /etc
# 1  
Old 05-19-2011
Unable to run 'su' and 'sudo' after changing permissions on /etc

Hello,
I'm running rhel6 64bit. Accidentally I ran
Code:
% 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:
Code:
-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:
Code:
Password: 
su: incorrect password

Could someone help with it?
Thanks.

Last edited by pludi; 05-19-2011 at 05:35 PM..
# 2  
Old 05-19-2011
found this from a quick google search. verify this works with one lesser needed package before executing. HTH

https://lists.sdsc.edu/pipermail/npa...il/024488.html
This User Gave Thanks to unxscorob For This Post:
# 3  
Old 05-20-2011
thanks for reply, your links looks very interesting and I'd definitely try it if I would complete stuck ... but fortunately I was able to restore permission for some pam files and /etc/shell which solved the issue.
I'm all set ... was able to fix it.
susja
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unable to run files with 700-777 permissions

I finally installed Chakra Linux and noticed whether I create or extract a file with 700, 755, 775 permissions a * sign is listed at the end of the filename: $ ls -l bin/32 total 16440 -rwxr-xr-x 1 501 utmp 6321496 09.12.2013 04:02 bitcoind* -rwxr-xr-x 1 501 utmp 10508613 09.12.2013 04:02... (10 Replies)
Discussion started by: Azrael
10 Replies

2. Shell Programming and Scripting

Script to give a user sudo permissions

Can some one please let me know a script which gives the user sudo permissions? Thanks in advance.... (6 Replies)
Discussion started by: Revanth547
6 Replies

3. Shell Programming and Scripting

sudo: sorry, you must have a tty to run sudo

Hi, Have a need to run the below command as a "karuser" from a java class which will is running as "root" user. When we are trying to run the below command from java code getting the below error. Command: sudo -u karuser -s /bin/bash /bank/karunix/bin/build_cycles.sh Error: sudo: sorry,... (8 Replies)
Discussion started by: Satyak
8 Replies

4. Shell Programming and Scripting

sudo: sorry, you must have a tty to run sudo

Hi All, I running a unix command using sudo option inside shell script. Its working well. But in crontab the same command is not working and its throwing "sudo: sorry, you must have a tty to run sudo". I do not have root permission to add or change settings for my userid. I can not even ask... (9 Replies)
Discussion started by: Apple1221
9 Replies

5. UNIX for Advanced & Expert Users

Help on sudo permissions to kill others process

I have to setup a sudo permission for a userA, so he can su to become userB and be able to do ONLY kill -9 on userB owned processes. (2 Replies)
Discussion started by: rizsyd
2 Replies

6. Shell Programming and Scripting

changing the permissions

HI, I wann give permissions to a folder which contains multiple folders..... how can i give permissions to all folder at a time tat means if i give permissions to main folder it the same permissions has to take on all the folders in the main folders how can i use one command to give... (1 Reply)
Discussion started by: nani1984
1 Replies

7. UNIX for Dummies Questions & Answers

Unable to use the Sudo command. "0509-130 Symbol resolution failed for sudo because:"

Hi! I'm very new to unix, so please keep that in mind with the level of language used if you choose to help :D Thanks! When attempting to use sudo on and AIX machine with oslevel 5.1.0.0, I get the following error: exec(): 0509-036 Cannot load program sudo because of the following errors:... (1 Reply)
Discussion started by: Chloe123
1 Replies

8. UNIX for Dummies Questions & Answers

Is there a way to find users who have sudo permissions for non root?

I want to check if in a host a set of persons have sudo access or not and I dont have root access to the host. (1 Reply)
Discussion started by: pristine
1 Replies

9. UNIX for Advanced & Expert Users

Changing permissions of a user

So I need to change the permissions of my user account. I can access the root account on the server, but don't know how to change the permissions of my user account. I was advised to try 'userconf' to see if I am part of a group, but I dunno how that works. ANyone who knows how to see the... (3 Replies)
Discussion started by: achink125
3 Replies

10. Shell Programming and Scripting

Changing Permissions

Is it possible to change the permissons for an entire directory in one shot? I'm telneting on to a linux server. ...just a beginner-- --Paul (4 Replies)
Discussion started by: pdavid
4 Replies
Login or Register to Ask a Question