Backtrack 5 Auto-login

Tired of logging in and starting X manually every boot? Today we're automating the process.

Today we're taking a break from our WiFi 101 series to focus on a few tips for BackTrack 5 Linux, my current favorite happytastic distro of choice even though Blackbuntu just released a new version that looks pretty good, so who knows we'll see.

Anyway, I just wanted to let you know we'll get back to the frames and packet sniffing and Wifi Protected Access Pre Shared Key stuff but at the moment I'm knee deep in a wicked mod and a rubber duck and a hacker con in Louisville so, hang tight.

Or if you want to go back and review what we've covered it's all at hak5.org and youtube.com/show/haktip and if you don't already have a USB WiFi radio with our beloved Realtek 8187 head over to the HakShop to grab one today -- we just got 'em in and they're all sexy in matte black. Booya.

So let's back track now back to backtrack and talk about X. The X Window System, or X11 or commonly just called "X" is both software and a network protocol that builds the foundation of a GUI or Graphical User Interface. It's considered a hardware abstraction layer, or HAL, that creates an in-betweeen for the actual hardware of your computer and the programs that want to, say, draw a window.

One of the beautiful things about X is that you can run it remotely over SSH. We've talked about this a bit on Hak5 and I'm sure we'll revisit it on HakTip soon but suffice it to say, X is Excellent. See what I did there?

So this brings us to the actual GUIs or User Interfaces. On Linux there are many Window Managers that use X. Much like Windows or Mac OSX, Window managers for Linux like Gnome or KDE define the user interface for all that WIMPY stuff.

WIMP. Because that's just what we needed -- another bacronym. Windows, Icons, Menus, Pointers. Thanks Xerox, seems you invented everything in the 70s.

Anyway, this whole long spiel has brough us back to backtrack, my distro of choice, from which I use Gnome. BackTrack 5 comes in both Gnome and KDE flavors but since I'm not cool enough to rock fluxbox I use Gnome.

If you've been using BackTrack for a while you know when you boot the first thing you typically do is login as root then start X with the startx command, how convenient. And while running as root isn't advised for any other distro, come on, it's a hacker distro. Hopefully you know what you're doing, eh?

Now this is where we get into the actual tip part of the show. While typing root, your password and startx is fun for a while eventually it gets kinda boring so today we're automating our login.


apt-get install rungetty
vi /etc/init/tty1.conf #comment out the "exec /sbin/getty -8 38400 tty1" line and add the line "exec /sbin/rungetty tty1 --autologin root"
echo startx >> /root/.bash_profile