jacking a macbook (immersion/submersion)
So my sister is out of the country for another month and a half, and she purposefully left her computer at my parents’ house, so I’ve started using it. It’s a MacBook with an Intel Core Duo running at 1.83 GHz with 1 GB of RAM, literally twice as fast as my iBook G4 with 1.28 GB of RAM, and it’s pretty sweet.
But naturally, I’ve had to re-build my environment, and had to hack the system to get an admin account running. (Believe you me, if someone has possession of your computer, it’s pretty damn easy to get access, no matter what sort of security controls you have, unless you actually were to rig a booby-trap or something. You know, like a small bomb that destroys the hard drive when you open the case, but I digress.)
So first things first: how to create an admin account on Mac OS X even if you don’t have admin rights:
- Boot up in single-user mode by holding down [Command][S]
-
Follow the instructions as described on the console:
fsck -yf mount -uw / sh /etc/rc
- Create a new user on the command line (from Adding a User From the Command Line on developer.apple.com `
dscl / -create /Users/XXXX
dscl / -create /Users/XXXX UserShell /path/to/shell
dscl / -create /Users/XXXX RealName “XXXX’s real name”
dscl / -create /Users/XXXX UniqueID nnn
dscl / -create /Users/XXXX PrimaryGroupID 1000
dscl / -create /Users/XXXX NFSHomeDirectory /Users/XXXX
passwd XXXX
dscl / -append /Groups/admin GroupMembership XXXX
`{: .block}
I only use the admin account for times when I need to sudo
. Run as admin and you might as well run Windows
I first used tcsh
because it was the first shell I ever used, way back in 1994, and it was the default shell on older versions of OS X, but I had grown used to bash
from my Linux experience. But, mostly because I wanted to be able to tell my terminal windows apart, I’ve grown to favor zsh
, which is already installed on Mac OS X 10.4 (Tiger).
Speaking of terminals, I prefer iTerm.app mostly because of the ability to use tabs.
If you decide to use zsh
, I would add the following to your .zshrc
file in your home directory:
precmd () { print -Pn "e]0;[%n] %~a" }
preexec () { print -Pn "e]0;[%n] $1a" }
There are far more customization options available as well. In addition to customizing the window title, you can customize the tab title as well.
The last thing I added was MacPorts, previously known as DarwinPorts. I had previously used Fink, so I thought I’d use something different.