Archive for March, 2011

HOWTO: Configure Tor + SASL + irc to connect to Freenode

Tags: , , , , , , , , ,

I fought this problem on the train into the city today, because my MiFi‘s hostname was not correctly reversing to it’s given IP (verified by dig) and Freenode was denying the connection; it looked like this:

Mar 22 06:51:41 *       Looking up irc.freenode.net
Mar 22 06:51:41 *       Connecting to chat.freenode.net (86.65.39.15) port 6667...
Mar 22 06:51:42 *       Connected. Now logging in...
Mar 22 06:51:42 *       *** Looking up your hostname...
Mar 22 06:51:42 *       *** Checking Ident
Mar 22 06:51:42 *       *** Your forward and reverse DNS do not match, ignoring hostname
Mar 22 06:51:55 *       *** No Ident response
Mar 22 06:51:55 *       *** Notice -- You need to identify via SASL to use this server
Mar 22 06:51:55 *       Closing Link: 166.199.4.113 (SASL access only)
Mar 22 06:51:55 *       Disconnected (Remote host closed socket).
Mar 22 06:52:05 Cycling to next server in Freenode...
Mar 22 06:52:05 *       Disconnected ().

I wanted to connect, to talk to the folks in #linux, and ask them about another question I had (see newer blog post about fullscreen VMware session for that). This was yet another example of the kind of Yak Shaving I deal with on a daily basis.

At first, I tried installing a few identd daemons, then some of the spoofing identd daemons, then purged them all and decided to try identifying using SASL like it suggested.

I did a few seconds of Google’ing and found a helpful website with a SASL plugin in C. I compiled that, installed it into /usr/lib/xchat/plugins, restarted XChat, and attempted to authenticate and identify using this plugin and the instructions.

If the site goes down, I have local copies of the files you need, just email me.

You’ll need to create a file called cap_sasl.conf and put it in ~/.xchat2/, which includes the following syntax:

/sasl [nickname] [password] FreeNode

So if your nickname (username on Freenode) was ‘foobar‘ and your password was “MyS3cretPas5word“, you’d put the following in that file:

/sasl foobar MyS3cretPas5word FreeNode

If you compiled this correctly and put it in the right place, you can also just issue a simple /help sasl command to get the syntax:

Usage: SASL <login> <password> <network>, enable SASL authentication for given network

When you load up XChat, you should see something like this in the main window (if the plugin works):

 Python interface loaded
 Display amarok loaded, type "/disrok help" for a command list
 Perl interface loaded
 Tcl plugin for XChat - Version 1.63 
 Copyright 2002-2005 Daniel P. Stasinski
 http://www.scriptkitties.com/tclplugin/
 Tcl interface loaded
 Loading cap_sasl.conf
 Enabled SASL authentication for FreeNode
 cap_sasl plugin 0.0.4 loaded

The last two lines are what you’re looking for. Now typing “/sasl” will show you the following:

 foobar:MyS3cretPas5word at FreeNode

This too, failed to authenticate me and validate my (incorrect) reverse DNS problem. What I saw was this:

Mar 22 20:24:02 *       Looking up irc.freenode.net
Mar 22 20:24:05 *       Connecting to chat.freenode.net (140.211.167.98) port 6667...
Mar 22 20:24:05 *       Connected. Now logging in...
Mar 22 20:24:05 *       *** Looking up your hostname...
Mar 22 20:24:05 *       *** Checking Ident
Mar 22 20:24:06 *       *** Couldn't look up your hostname
Mar 22 20:24:19 *       *** No Ident response
Mar 22 20:24:52 *       Closing Link: 32.138.186.102 (Connection timed out)
Mar 22 20:24:52 *       Disconnected (Remote host closed socket).
Mar 22 20:25:02 Cycling to next server in Freenode...

I decided to investigate a different solution: Tor!

Read the rest of this entry »

SOLVED: How to use Ctrl-Alt-F1 in VMware with Linux guests

Tags:

VMware logoIf you’re like me, you probably use VMware Workstation (or VMware Player or VMware Fusion) quite a bit to test different aspects of other operating systems without having to break your host machine.

I do development and testing on Linux, and need to ensure that the latest Linux distributions don’t break my code, or that a kernel module doesn’t provide a broken interface to the subsystems my code relies upon.

I also use VMware Workstation for testing out various Windows and Linux distributions either to run live CDs such as KNOPPIX or install a full operating system without having to have a dedicated computer just for that one set of tests directly.

Before Linux had a stable GUI environment, we all had to juggle across multiple consoles with L-ALT-Right/Left cursor key to jump between virtual console 1-7 and back.

Once Linux had adopted a stable GUI (XFree86, xorg) we had a way to run shells, via xterm/Terminal sessions in X, but we also wanted a way to get back to the console environment if we needed to, without dropping out of X. The way to do this is by hitting Ctrl-Alt-Fx (where ‘x’ is the console number you want to jump to).

Unless you change your /etc/inittab, consoles F1-F6 are dedicated to text-based console sessions, while F7 and up are dedicated to X itself. In other words, if you haven’t changed your configuration, the first X session that runs on your machine will be available via Alt+F7. If you add an additional X session, it would be available on Ctrl-Alt-F8, and so on.

Herein lies the problem, if you are on a Linux host, running VMware Workstation with Linux guests running within it. If you initiate a Ctrl-Alt-F1 from within a VMware guest session running Linux, the host will grab the keyboard input and send you to the host’s F1 console session, not the one inside the guest, which is probably where you intended it to go.

Part of this is due to the fact that the key command “Ctrl+Alt” has a very specific meaning in VMWare Workstation. it is used as the trigger to VMware to release the keyboard and mouse control from the guest and return it back to the host.

You can reset this combo, but it’s best not to.

If you want to send a Ctrl-Alt-Fx command to the guest, you need to use a slightly different combination: Ctrl+Alt+Space

Let’s go through this, step by step:

  1. You load up your Linux guest in VMware Workstation, and it loads up a graphical environment inside the guest.
  2. After X loads in the guest, you want to drop to the console in the guest to perform some action
  3. With the guest having the keyboard/mouse focus, you press Ctrl-Alt-Space, release Space, then hit the F1 key, to drop you to the F1 console of that guest’s session.
  4. To return to the X session, you can simply hit Alt-F7 (while the guest has the keyboard and mouse focus), or you can hold left-Alt, and use the right cursor arrow key on your keyboard to cycle through all of the console sessions until X re-appears.

Voila!

Bad Behavior has blocked 1649 access attempts in the last 7 days.