Wednesday, July 4, 2007

SSH Public Key Authentication

#On the computer that is making the inital connection (Call this Computer A)
ssh-keygen -t rsa
ssh user@computer_b "cat >> .ssh/authorized_keys" < .ssh/id_rsa.pub

#On Computer B (authorized_keys needs to have 600 permissions or it won't work)
chmod 600 .ssh/authorized_keys

Debian WPA Ndiswrapper

#Edit /etc/network/interfaces with a text editor

#My Home AP
auto wlan0
iface wlan0 inet dhcp
wpa-ssid echo
wpa-psk secretwordhere
wpa-driver wext
wpa-key-mgmt WPA-PSK

Debian 4.0 Ndiswrapper

Dell 1350 Wireless Inspirion Laptop

#Update & Install ndiswrapper
apt-get -y update &amp;amp;amp;amp;& apt-get -y upgrade
apt-get install ndiswrapper-utils

#Remove the native driver they created
rmmod bcm43xx
#Stop it form loading on startup
echo blacklist bcm43xx >> /etc/modprobe.d/blacklist

#Find the inf file for your card
#http://ndiswrapper.sourceforge.net
#For the 1350 Wireless Card in my laptop
#ftp://ftp.us.dell.com/network/R83097.EXE
unzip R83097.EXE -d wireless
ndiswrapper -i wireless/AR/bcmwl5a.inf

#Add ndiswrapper to startup
echo ndiswrapper >> /etc/modules

#Ndiswrapper module
apt-get -y install build-essential module-assistant
m-a prepare
m-a a-i ndiswrapper
modprobe ndiswrapper

#Test
iwlist scan

Monday, July 2, 2007

Fedora 7 & WPA

Inspirion 5160 Dell 1350 Wireless Card

*Note this clobbers the conf file that was there
wpa_passphrase ssid > /etc/wpa_supplicant/wpa_supplicant.conf

Open the config in a text editor and delete the commented line which has your PSK in plain text. Also edit the line by using an example from /usr/share/doc/wpa_supplicant*/examples
vi /etc/wpa_supplicant/wpa_supplicant.conf

Start WPA
wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

Make sure it's assocaited
iwconfig
ifconfig

Get an IP address
dhclient wlan0

Test
ping -c 4 www.google.com

Add to startup
echo "wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf &" >> /etc/rc.local
cd /etc/sysconfig/network-scripts/
mv ifcfg-eth0 ifcfg-wlan0
Replace eth0 w/ wlan0 & delete the line with HWADDR
vi ifcfg-wlan0

Fedora 7 & Ndiswrapper

ATRPMS & Freshrpms repos (I started with livno & disabled it so my fedora is probably going to crash)
Dell Inspirion 5160 1350 Wireless something built in

Install Ndiswrapper
yum -y install dkms-ndiswrapper
ndiswrapper -i bcmwl5a.inf

Remove the sorry drivers they made for linux
rmmod bcm43xx-mac80211
echo "blacklist bcm43xx-mac80211" >> /etc/modprobe.conf

Load ndis
modprobe ndiswrapper
iwlist scan

Make it load on boot
ndiswrapper -m