The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - Newcomers (http://hintsforums.macworld.com/forumdisplay.php?f=15)
-   -   No write permissions for admin group (http://hintsforums.macworld.com/showthread.php?t=98010)

Hal Itosis 01-22-2009 01:45 PM

Quote:

Originally Posted by yonio (Post 514827)
That's exactly the problem. As an administrator, why don't I get the 'root' privileges automatically? I'm a kernel developer for several unix based platforms, so I thought that I'll be just fine with OS X, but I find this whole thing really annoying.

Because -- in OSX Client -- admins are not "automatically" root-privileged.
If you want omnipotence, grab a root shell: sudo -s


Quote:

Originally Posted by yonio (Post 514827)
BTW what is this 'wheel' group?

gid =0
It's the companion to uid = 0 (root),
and only root shall be a member.
Thus sayeth the [BSD] Unix Lord. ;)

hayne 01-22-2009 01:49 PM

Quote:

Originally Posted by yonio (Post 514827)
As an administrator, why don't I get the 'root' privileges automatically?

admin is not root
An admin account is one which can attain root privileges temporarily (for one command) by using 'sudo'.

The 'root' account is disabled by default in OS X since it is a security risk to be logged in as root - especially in a GUI.
And all uses of 'sudo' are logged - which is an advantage.

hayne 01-22-2009 01:52 PM

Note also that the 'sudo' command only prompts for a password if it has been more than (by default) 5 minutes since your last use of 'sudo'.

trevor 01-22-2009 01:54 PM

Quote:

Originally Posted by yonio (Post 514827)
That's exactly the problem. As an administrator, why don't I get the 'root' privileges automatically?

I'm not sure I understand the question. As an administrator (or more precisely as a member of the admin group), you get access to root privileges automatically, because in a default install OS X has /etc/sudoers set to include the line
Code:

%admin  ALL=(ALL) ALL
meaning that anyone in the group admin has sudo access to all root privileges. If you would like a more secure setup, you can limit this privilege.

So, as an administrator, you DO get root privileges, simply by using sudo. Sudo access is logged (another good security measure) in /var/log/system.log and /var/log/secure.log. Sudo usage also has some other security features built in.

Quote:

Originally Posted by yonio
I'm a kernel developer for several unix based platforms, so I thought that I'll be just fine with OS X, but I find this whole thing really annoying.

Because you have to type sudo, you find that annoying? Which unix-based platforms are you referring to? I can't think of any brand of unix that gives just anyone root privileges--you have to log in to the root user to get root privileges, or use su or sudo, the same as in OS X.

Quote:

Originally Posted by yonio
BTW what is this 'wheel' group?

It is root's group. A much more verbose explanation is here: http://administratosphere.wordpress....e-wheel-group/

Trevor

Hal Itosis 01-22-2009 01:55 PM

Quote:

Originally Posted by tlarkin (Post 514805)
In this case I am not the end user though, I am the systems administrator. This is for an enterprise environment and not an end user machine. I have this set up and working on over 6,500 macs. There is a deployment up in Minnesota with over 12,000 Macs doing pretty much the same thing that I am.

I have been tossing certain things in the standard $PATH for years now, and while everyone has always told me the same thing you guys have, I have not had any issues. Of course I toss things in there that I test like a billion times before I ever put it out in production. I also disable software update and don't allow end users to update anything that isn't approved and tested.

I have tossed several custom shell scripts in the standard $PATH and then created launchd items that execute that path, like /usr/sbin/myscript.sh for example.

I am just really playing devil's advocate here is all.:D

No one said it doesn't "work" (quite the opposite in fact), just that it's not kosher.
Granted, there's no guarantee that Apple will erase non-Apple items in those areas,
(quite the opposite in fact). It's just that --if/when it ever does happen-- they will be
fully within their rights to do so.

Hal Itosis 01-22-2009 02:05 PM

Quote:

Originally Posted by hayne (Post 514834)
Note also that the 'sudo' command only prompts for a password if it has been more than (by default) 5 minutes since your last use of 'sudo'.

That's why i figured the sudo -s shell would be a good choice for yonio.
He said he's already "annoyed" -- why let 5 minute time-stamps add to
that frustration? A sudo -s shell will last until the user types control-D.

;)

Mikey-San 01-22-2009 02:12 PM

Quote:

The OS X boot process is, Power > POST > EFI/Firmware > launchd > loginwindow
That is incomplete. After EFI/OF inits the device tree, the bootloader loads the kernel. If there is a kernel cache available, that gets used to circumvent having to link in all the necessary device drivers. Kernel is then responsible for bringing up IOKit and then launchd is started to complete the startup procedure and manage system processes.

It's not just something that runs scripts. It's the root parent process of all processes in Mac OS X.

tlarkin 01-22-2009 02:14 PM

Quote:

Originally Posted by Hal Itosis (Post 514837)
No one said it doesn't "work" (quite the opposite in fact), just that it's not kosher.
Granted, there's no guarantee that Apple will erase non-Apple items in those areas,
(quite the opposite in fact). It's just that --if/when it ever does happen-- they will be
fully within their rights to do so.

Yeah I agree, but I also think if Apple starts breaking third party compatibility it will royally piss off their user base. I remember when 10.5 came out and the amounts of things it broke, and I met some unhappy Apple users. It has worked for me from the beginning, and I have done it in Linux too. A lot of developers do that, and they also create directories too like /opt and so forth. I haven't ever seen a system update get rid of my launchd scripts that I toss in /usr/sbin. Maybe it will happen one day, and I will be broken of my bad habits, but I don't think Apple is really going to tweak the Unix end that much more than they already have.

As for the sudo thing. When I do extensive terminal work I use first authenticate using sudo -s which opens up a root session in terminal and I am not sure if there is any time out.

Mikey-San 01-22-2009 02:19 PM

Quote:

Originally Posted by tlarkin (Post 514844)
Yeah I agree, but I also think if Apple starts breaking third party compatibility it will royally piss off their user base.

But if developers are doing incorrect things, whose fault is it?

Quote:

I remember when 10.5 came out and the amounts of things it broke, and I met some unhappy Apple users.
I remember when Leopard came out and Unsanity broke it severely because they were doing things they weren't supposed to be doing. And then Logitech was silently installing Unsanity's broken software and breaking more Leopard installs.

I'm not getting into the /sbin argument, but you're making a lot of fundamentally flawed assumptions in this thread.

trevor 01-22-2009 02:24 PM

Quote:

Originally Posted by tlarkin (Post 514844)
A lot of developers do that, and they also create directories too like /opt and so forth.

You seem to be grouping both of these practices in one category, but that's not appropriate.

The "lot" of developers who write to the system directories are wrong. On the other hand, the developers who create directories like /opt are just fine. /usr/local is traditional, but not at all required. If developers want to create new directories like /sw (used by fink) and /opt, that's just fine.

Trevor

hayne 01-22-2009 04:07 PM

Quote:

Originally Posted by Hal Itosis (Post 514841)
That's why i figured the sudo -s shell would be a good choice for yonio.
He said he's already "annoyed" -- why let 5 minute time-stamps add to
that frustration? A sudo -s shell will last until the user types control-D.

The 'sudo -s' shell is a good tool to have at your disposal. I use it myself when I have an extended amount of stuff to do that requires 'root' or (especially) if I need to 'cd' into root-only directories.

But I don't recommend it as a general use anytime you need to run a few commands with 'root' privileges. A certain amount of "annoyance" is good - it reminds you that you are doing something that might break the system. And anything that slows you down when doing such things is good.

Mikey-San 01-22-2009 04:11 PM

Quote:

Originally Posted by hayne (Post 514875)
anything that slows you down when doing [potentially dangerous stuff] is good.

Quoting this for so much truth it practically hurts.

tlarkin 01-22-2009 04:29 PM

Yeah I agree with you Mikey, I am just saying it is possible. While I have read through a lot of the Apple white pages I have also seen countless developers put stuff where it doesn't belong. I think Apple does look out for this type of stuff to some extent, especially legit third party developers.

While, I know I have bad habits, I don't see Apple wiping out my scripts I put in /usr/sbin and there are certain reasons I don't like putting things in user folders, especially with things like 'repair permissions.'

Also, Apple doesn't always make it easy, and some developers are clueless and I don't know everything. I just get by with what I can.

Hal Itosis 01-22-2009 05:18 PM

Quote:

Originally Posted by hayne (Post 514875)
But I don't recommend it as a general use anytime you need to run a few commands with 'root' privileges. A certain amount of "annoyance" is good - it reminds you that you are doing something that might break the system. And anything that slows you down when doing such things is good.

Agreed (and, i myself don't leave such shells laying-in-waiting.
i do what needs doing and then control-D out of there).

I was making that special recommendation to yonio...
"a kernel developer for several unix based platforms,"
who found "this whole thing really annoying". :)

--

sudo
alone only gets us so far.
We cannot do this for example:
sudo cd /var/db/dslocal/nodes/Default

[so it's either type long pathnames or...]


All times are GMT -5. The time now is 10:18 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.