Showing posts with label sysadmin. Show all posts
Showing posts with label sysadmin. Show all posts

Tuesday, February 1, 2011

Restoring admin rights

I've not had a reason to do this recently, but was curious so I decided to try. I wanted to give myself admin rights from the command line, specifically single user mode.

For those of you who don't know, single user mode is a command line only way to interact with the system as root, in most cases its possible without a password. Hold command+s when booting and see what it looks like! (if you get scared, just type "exit")

Once in single user mod (SUM), you can interact with the system by using commands. So, in this case, I want to add my user "rusty" to the admin group on the machine... This is what I did.

First, start computer in SUM - hold command+s at boot

Second, after you see the prompt (root#) type "/sbin/mount -uw /" (there are two spaces in there, its important not to loose them!)
Hit Return.

Third, I need to start the Directory Services, I do so by typing:
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
Hit Return.

Fourth, Now that Directory Services is started, I can make the appropriate changes use dscl.
To add my "rusty" account to the admin group, I use:
dscl . append /Groups/admin GroupMembership rusty

Fifth,
Once you are done making changes, exit SUM using the command "exit"

There are lots of other cool tricks with dscl, give it a try and post some of your favorites!

Saturday, November 27, 2010

SysAdmin Video Series: Payload Free Package

The second video focuses on creating a payload free package.

In this video I create a payload free package. This package will only install a script, it won't install anything! Its a very useful package type! This video also covers the difference between the different types of installation scripts. Download the files used in the video to follow along! NOTE: I do not have the script written well for InstaDMG. You should use the target of $3. Check this afp548.com thread for great scripts to run with InstaDMG. Watch the video

Thursday, November 4, 2010

SysAdmin Video Series: First Boot Package

The introductory video to the SysAdmin Video Series is here!

Following is a video on building a package that will run a script when a computer first boots. This is useful for instadmg when you can't apply scripts during the build train. Its also useful for other uses.

This video also covers some basics to Iceberg packaging and launchd plists. Download the files used in the video here.

Watch the video here.

Enjoy!