I set the "usr" folder to unlimited access

prime

Walking No-Fun Ball
Hello,

I recently had a serious lapse of judgment, and typed this command in the Terminal:

sudo chmod 777 /usr

It obviously caused some serious problems. I booted into single user mode, and did this so I could use sudo again:

chmod 4111 `which sudo`

But, the rest of the usr folder is still out of whack. I launch the Terminal and instead of "Welcome to Darwin!" I get "login: setgroups: Operation not permitted"

How can I fix the permissions of the usr folder to get it back to what it should be?

Cheers,
- Chris
 
Originally posted by Jadey
drwxr-xr-x 9 root wheel 306 May 18 10:09 usr

Sorry, but that's not very helpful. I have no idea of what I am supposed to do with what you wrote in your post.
 
One little thing - I just checked the Terminal, and it seems I still see "Welcome to Darwin!" after "login: setgroups: Operation not permitted".
 
sudo chown root:wheel /usr

Once that is done then set the permissions with this command

sudo chmod 755 /usr

The example he gave was to show you how they were supposed to be setup...
 
Originally posted by prime
Hello,

I recently had a serious lapse of judgment, and typed this command in the Terminal:

sudo chmod 777 /usr
This should affect only /usr, nothing else; are you saying you actually ran sudo chmod -R 777 /usr?
If so, there are several files which need to be fixed (/usr/bin/login being the one you've seen complain):
Code:
-r-sr-xr-x  1 root  wheel    25368 Dec 21 00:59 /usr/bin/at
-r-sr-xr-x  1 root  wheel    25368 Dec 21 00:59 /usr/bin/atq
-r-sr-xr-x  1 root  wheel    25368 Dec 21 00:59 /usr/bin/atrm
-r-sr-xr-x  1 root  wheel    25368 Dec 21 00:59 /usr/bin/batch
-r-sr-xr-x  1 root  wheel    25452 Dec 21 00:59 /usr/bin/chfn
-r-sr-xr-x  1 root  wheel    25452 Dec 21 00:59 /usr/bin/chpass
-r-sr-xr-x  1 root  wheel    25452 Dec 21 00:59 /usr/bin/chsh
-r-sr-xr-x  1 root  wheel    32868 Dec 21 00:59 /usr/bin/crontab
-r-sr-xr-x  1 root  wheel    20516 Dec 21 00:59 /usr/bin/login
-r-sr-sr-x  1 root  daemon   30440 Dec  8 11:49 /usr/bin/lpq
-rws--s--x  1 root  daemon   31120 Dec  8 11:49 /usr/bin/lpr
-r-sr-sr-x  1 root  daemon   26324 Dec  8 11:49 /usr/bin/lprm
-r-sr-xr-x  1 root  wheel    29756 Dec 21 00:59 /usr/bin/passwd
-r-sr-xr-x  1 root  wheel    20312 Dec 21 00:59 /usr/bin/quota
-rwsr-xr-x  1 root  wheel    20184 Dec 21 00:59 /usr/bin/rlogin
-r-sr-xr-x  1 root  wheel    15172 Dec 21 00:59 /usr/bin/rsh
-rwsr-xr-x  1 root  wheel    20556 Mar  8 19:50 /usr/bin/setregion
-r-sr-xr-x  1 root  wheel    57804 Dec 21 00:59 /usr/bin/smbutil
-r-sr-xr-x  1 root  wheel    14704 Dec 21 00:59 /usr/bin/su
---s--x--x  1 root  wheel   107916 Mar 27 18:36 /usr/bin/sudo
-r-sr-xr-x  1 root  wheel    43820 Feb 20 00:12 /usr/bin/top
-r-sr-xr-x  1 root  wheel   250748 Feb 20 00:12 /usr/sbin/DirectoryService
-r-sr-xr-x  1 root  wheel    59924 Dec 21 00:59 /usr/sbin/netstat
-r-sr-xr-x  1 root  wheel    15028 Dec 21 01:00 /usr/sbin/scselect
-r-sr-xr-x  1 root  wheel   402700 Dec 21 00:59 /usr/sbin/sendmail
-r-sr-xr-x  1 root  wheel    14700 Dec 21 00:59 /usr/sbin/sliplogin
-r-sr-xr-x  1 root  wheel    18512 Dec 21 00:59 /usr/sbin/traceroute
 
Also (the first list contained setuid files, these are setgid only):
Code:
-r-xr-sr-x  1 root  kmem    19520 Dec 21 00:59 /usr/bin/fstat
-r-xr-sr-x  1 root  daemon  39976 Dec  8 11:49 /usr/bin/lpc
-r-xr-sr-x  1 root  kmem    14892 Dec 21 00:59 /usr/bin/nfsstat
-r-xr-sr-x  1 root  kmem    18956 Dec 21 00:59 /usr/bin/uptime
-r-xr-sr-x  1 root  kmem    18956 Dec 21 00:59 /usr/bin/w
-r-xr-sr-x  1 root  tty     14836 Dec 21 00:59 /usr/bin/wall
-r-xr-sr-x  1 root  tty     14396 Dec 21 00:59 /usr/bin/write
-r-xr-sr-x  1 root  kmem    14996 Dec 21 00:59 /usr/sbin/iostat
-rwxr-sr-x  1 root  kmem   106928 Dec 21 00:59 /usr/sbin/lsof
-r-xr-sr-x  1 root  kmem    19428 Dec 21 00:59 /usr/sbin/pstat
-r-xr-sr-x  1 root  kmem    13928 Dec 21 00:59 /usr/sbin/trpt
-r-xr-sr-x  1 root  kmem    13784 Dec 21 00:59 /usr/sbin/trsp
 
I'm still quite clueless - I don't know what I am supposed to do with what you guys posted. Chmod has this syntax:

sudo chmod (some 3-digit code) (the file/folder)

Those lists that you are giving me are not even similar - they don't tell me what codes to put in, so they are pretty much useless to me.

I'm guessing that I have to set the permissions of the files that you said to "wheel", "daemon", "tty", etc., but I don't know what permission numbers I have to give to chmod in order to do that.

Edit: I figured it out - I looked over the man pages and figured out what you mean. Just ignore this post.
 
I did just as you said - set all the permissions for all the files you listed to what they should be. After I did all that, I closed the Terminal window and opened a new one - it just said it couldn't initialize the shell, then opened a blank window with a dam pinstripe in it.

I then went to the Terminal preferences and set it to use "/bin/tcsh", rather than the default (which I believe is "/bin/tcsh"). It then worked fine, except for a few glitches.

For one, it doesn't say anything before the prompt. No "Welcome to Darwin!", no "login: setgroups: Operation not permitted", no "You were stupid so I'm punishing you!", or anything else.

Also, the device name is wrong (I think). It's supposed to be "ttyp1" as far as I remember, but it's now "ttyp8".

Edit: Yet another problem. "sudo su" does no longer work. When I type "sudo su", it just prints "sudo: su: command not found" and doesn't prompt for my password, or enter root mode.

Oh, another problem - Disk Copy refuses to mount disk images. Every time I try, I get "Unknown error 192"

This is really getting ridiculous. I think I'll just have to re-install OS X.
 
Originally posted by prime
...
This is really getting ridiculous. I think I'll just have to re-install OS X.[/i]

Definitely sounds like there was some collateral damage; it would most likely be much simpler to reinstall than to track it all down...I know there are several threads around here discussing doing reinstalls.
 
Oops, sorry, I thought from your post you just wanted to see the default permissions, owner and group. I should have included instructions. :D

On another matter, BSDimwit, I'm not a "he" :)
 
Back
Top