Posts: 3
Threads: 2
Joined: May 2004
Reputation:
0
hi!
For some day ago i wrote chmod 777 * in my /bin folder (dont ask me why:P ), but now I cant switch users.
I just get the error message "su: incorrect password" all the time.
Anyone know how to fix this? :)
[klumpen@klumpen klumpen]$ su -
Password:
su: incorrect password
I can log into root tru one TTY.
Posts: 187
Threads: 4
Joined: Mar 2004
Reputation:
0
2004-06-14, 08:39 AM
(This post was last modified: 2004-06-14, 04:46 PM by z0ny.)
The problem is that "su" has to be suid in order to read from the shadow file of your system to verify the password you have given. By issuing "chmod 777 *" you deleted the suid bit (777 = 0777). You have to reset this bit by executing "chmod 4755 /bin/su". That should fix the problem. Anyways, "777" is never a very good idea...
z0ny
Posts: 3,631
Threads: 899
Joined: Dec 2003
Reputation:
0
interesting,
does the same principle apply to apache directories and files
i chmod 755 the dirs
and 644 the files
?
Posts: 187
Threads: 4
Joined: Mar 2004
Reputation:
0
What exactly do you mean?
z0ny
Posts: 187
Threads: 4
Joined: Mar 2004
Reputation:
0
Well 'su' for example is a program that requires root privileges in order to verify the passwords. Normal users aren't allowed to view the (hashed) passwords of other users but those users are allowed to gain (root) access via 'su'. When they execute 'su' it runs under user permissions so it wouldn't have access to the passwords. And here comes the suid bit (4): it grants that binary (and only that file) access to things you normally can access as root only.
Apache doesn't need that. It would even be a security flaw to set the suid bit on apache binaries as exploits may elevate the privileges to root.
z0ny