Setup VNC on your linux box (without having to launch another session!)

So my main problem with most vnc servers available for linux is their ability to log me into my machine with a completely different environment than what I am already logged into. This makes me mad. On windows, by default, you log into your main profile, end of story. This is how I like it. Using x11vnc, we can log into our current session without any problems! Heres How:: <br></br> apt-get install x11vnc<br></br> mkdir ~/.

Continue reading ↦

Problems with Alsa Audio and setting your default device

So i installed debian 6 and i have an external soundblaster usb device as my soundcard. Now Debian picks it up fine using the alsamixer software yet this device does not get set as the default device automatically. meaning firefox and other sound programs where i cant change the mixer to use have problems playing audio. Using this page: http://www.seehuhn.de/pages/alsa and my brain, I was able to create a /etc/asound.conf file and put the lines in it that this guide specified:

Continue reading ↦

Reset your MySQL root password!

So i accidentally changed my password for my root account like a year ago and forgot what it was when I needed to add a new database. Very bad for a sysadmin I know but it will probably happen to you at some point in your career if it has not already! Here’s how to reset it: 1) Stop mysqld and restart it with the –skip-grant-tables option. mysqld –skip-grant-tables 2) Connect to the mysqld server with this command:

Continue reading ↦

Port forwarding to internal clients via IPtables

I finally took the venture into natting/masquerading my traffic to allow my internal boxes to be accesed from the outside world. It is really quite easy actually. As long as you are using static addressing on the private lan or set your dhcp server to always give the box u want to access the same ip, you are all set. Add the following rules to iptables and you’re golden: -A PREROUTING -p tcp -d 141.

Continue reading ↦

Need to record all input and output of your tty session?

An easy way to do this is start a “script” session using a nifty program called script. It basically puts you in a virtual terminal and records everything you type and the corresponding output. script -a /home/user/bashlog.txt Then just type exit when you want to stop logging.


Setting up your LDAP Clients..

NOTE: This was done on Debian 5 Lenny. This does not apply to Squeeze. A new guide will be released shortly. Generally your LDAP clients will connect to the ldap server to get user details and authentication. A lot of people will have the ldap server and client run on the same machine which is probably your setup. Here is how to install the necessary software and configure it so that your server can contact the ldap server and users can authenticate with ease.

Continue reading ↦

Migrating Users from /etc/passwd to LDAP

Most people just use the normal linux user system /etc/passwd and shadow files for their users. But migrating this can be a good thing as you can centralize your users and have more fine-tuned control over them. (online ldap configuration anybody?) Here’s my guide on how to migrate your linux users to your ldap database. It was done on debian lenny with a lot of ache and pain. Hopefully this will make it easier for you.

Continue reading ↦

Setting Up An LDAP Server!

NOTE: This was done on Debian 5 Lenny. This does not apply to Squeeze. A new guide will be released shortly. By the ! I mean get ready to dedicate some time. This might take a while and might not work perfectly when you first install it. First install the software. It will then ask you some questions. # apt-get install slapd ldap-utils migrationtools (only install migrationtools if moving user accounts from local /etc/passwd file)

Continue reading ↦

Enable Internet Connection Sharing Through Linux w/DHCP

1) edit /proc/sys/net/ipv4/ip_forward to contain the value of 1 instead of 0. 2) modprobe iptable_nat 3) make a bash script containing the following: NOTE: Change anywhere it says “eth3? to the interface where your internet connection is coming in from. edit the -s statement to the network and netmask of the private network you plan on creating. #!/bin/bash if [ “$1” == “enable” ]; then iptables -A POSTROUTING -t nat -o eth3 -s 10.

Continue reading ↦

802.1X + EAP-PEAP + MS-CHAPv2 + A Linux Terminal

So my campus decided to employ 802.1X protocol for authentication over the wired network in the dormatories at Michigan Tech. This is all great except for the part that normal switches can’t participate in the authentication because of the EAPOL frames exchanged before DHCP at layer 2. What we will need to do is connect directly to the wall port while running a program called wpa_supplicant which will take care of the authentication then we will use dhclient to talk to a dhcp server and get an IP addy.

Continue reading ↦