Category Archives: tools

All things related to tools I use

putty x11 forwarding stops working after su

After finding this once, scouring the web again trying to find the solution, I figured this time I would take note. If you ever have to forward x11 locally using putty, you’ve probably noticed that it doesn’t work after switching users with su. Here’s what you need to do to fix this:

First try to forward xclock

[user@localhost ~]$ xclock
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: MIT-MAGIC-COOKIE-1 data did not match
Error: Can't open display: localhost:10.0

Notice the MIT-MAGIC-COOKIE-1 error – next let’s see what xauthorization is setup. Drop back down to the user you su’d from:

[user@localhost ~]$ exit
[root@localhost ~]# xauth list
localhost/unix:10  MIT-MAGIC-COOKIE-1  1234567890abcdefghijklmnopqrstuv

Now let’s add this “magic cookie” to the authorized x11 terminals list for the user we need to su to:

[root@localhost ~]# su - user
[user@localhost ~]$ xauth add localhost/unix:10  MIT-MAGIC-COOKIE-1  1234567890abcdefghijklmnopqrstuv
[user@localhost ~]$ xclock

Now your forwarding should work.

Packet sniffing – not Sharpie sniffing!

Seriously, have you ever smelled those Expo dry erase markers? I really think you can get high off those things.  Honestly though, let’s take a look at a case where you might need to sniff packets instead of Sharpies.  If you’ve ever worked in IT, at some point, you’ve needed a packet sniffer even if you didn’t realize it.  As a desktop IT person, if a server you’re trying to communicate with isn’t responding appropriately, a packet sniffer will prove it.  As an engineer it will give you the proof you need to explain to people in Vietnam why they should not be in the networking business.  Let’s take a look at two tools that will become invaluable to you in IT so long as you know what you’re looking at and how to use the information they provide (Wireshark and tcpdump).
Continue reading

how to:Reset lost root password (Linux)

Also known as the console hack this is an essential skill when supporting Redhat (And other) Linux systems.  Here are the basic steps to reset your lost root password on a system running Redhat Enterprise Linux (RHEL):

Boot your system from the RHEL DVD and at the boot prompt type “linux rescue” or hit F5:
Screenshot

Next select 1)  Language and 2) Keyboard Layout:
1) Screenshot (Language)
2) Screenshot (Keyboard)

To save on time choose 1) “no” to skip network interface setup and let RHEL 2) “continue” to mount any system it can find on your existing disk:
1) Screenshot (No)
2) Screenshot (Continue)

If the RHEL DVD found your installation it will automatically mount the / (root) partition under /mnt/sysimage
Screenshot

Now that you have a shell use the following commands to change your working root directory and reset the password for the root user:

sh-3.2 #chroot /mnt/sysimage
sh-3.2 #passwd

You will be prompted for a new root password.  Set the desired password, reboot, and you’re off to the races!

Shrewsoft VPN: 64bit VPN client for Cisco 3000 VPN Concentrators

You heard it right folks – you can have access from your 64-bit Windows systems to those old Cisco 3000 VPN concentrators. Here’s how to setup Shrewsoft to work with a standard Cisco 3000 VPN concentrator (Client download is here):

After you have installed the software, open the access manager, click “Add“, and type in the hostname or IP address to which you wish to connect:
Screenshot

Next click the “Authentication” tab and change the “Authentication Method” to “Mutual PSK + XAuth” (This assumes you have a named group and group password).  Change the “Identification Type” to “Key Identifier” and enter the group name (Provided by the VPN concentrator administrator) under “Key ID String“:
Screenshot

While still on the “Authentication” tab, click the sub-tab labeled “Credentials” where you will set your group password in the “Pre Shared Key” field:
Screenshot

That’s about it really – click “Save” and you’re ready to connect.  Highlight your new connection in the connection manager and click “Connect“.  Provide your user credentials and your tunnel is established:
Screenshot

how to: domain information groper (dig) basics

If every IT administrator was issued a swiss army knife full of technical tools, dig would certainly be in it.  If you have ever hosted, registered, or administered a domain name or DNS server then you have likely run across this tool at some point.  Here are the basics of DNS and how to use dig to get the information you need:

NOTE: Headers and footers have been removed from these queries for ease of use.  In headers and footers you will see information regarding the version of dig you are using and how long your query took respectively.
Continue reading

gnu utilities for windows

Great for when you need grep, gzip, tar, and many more in a Windows environment (Gzip is especially great for compressing logs quickly and efficiently at 2AM when you’re out of disk space).

Check ’em out: http://gnuwin32.sourceforge.net/

how to: port tunneling over ssh using putty

Setting up port tunneling for quick access to a remote port that is blocked by an uncontrolled firewall is a necessity sometimes.  You may have heard this referred to as a “stunnel” (SSH tunnel).  Here’s a quick synopsis of how to setup remote port tunneling over SSH using putty:
Continue reading