#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
Wednesday, July 4, 2007
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
#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;& 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
#Update & Install ndiswrapper
apt-get -y update &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
*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
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
Monday, November 20, 2006
Samba on Centos Anonymous Read Only
I wanted to start with an empty config. So log in as root and do the following:
cd /etc/samba
mv smb.conf smb.conf.bak
vi smb.conf
Place the following in smb.
[global]
workgroup = Home_lan
netbios name = Centos
security = share
[public]
comment = public
path = /server/public
force user = dj
force group = home
read only = Yes
guest ok = Yes
The directory public is owned by dj & the group is home. Now test the config file.
testparm
If everything checks out ok then start samba.
service smb start
I did give the user dj a samba password by doing the following but I doubt you'll need it. When I connected w/ a windows box it didn't ask for a logon.
smbpasswd -a dj
Credits
http://us4.samba.org/samba/docs/man/Samba-HOWTO-Collection/FastStart.html
cd /etc/samba
mv smb.conf smb.conf.bak
vi smb.conf
Place the following in smb.
[global]
workgroup = Home_lan
netbios name = Centos
security = share
[public]
comment = public
path = /server/public
force user = dj
force group = home
read only = Yes
guest ok = Yes
The directory public is owned by dj & the group is home. Now test the config file.
testparm
If everything checks out ok then start samba.
service smb start
I did give the user dj a samba password by doing the following but I doubt you'll need it. When I connected w/ a windows box it didn't ask for a logon.
smbpasswd -a dj
Credits
http://us4.samba.org/samba/docs/man/Samba-HOWTO-Collection/FastStart.html
Tuesday, November 14, 2006
Migrating from Ubuntu to Centos
First blog, it's gona be kinda ugly.
My server orginally was running Ubuntu Breezy Badger. I liked ubuntu but too many problems started happening. When I added a new harddrive I figured it was time to update to dapper or maybe even edgy. Those were even worse then breezy. Hence the switch to centos. Might as well put that RHCT to use.
A little about the partitioning scheme the server is using for this migration. Theres two harddrives each 250gb.
/dev/sda5 is the new LVM partition. The goal is to move the data from /dev/hda6 onto the new lvm parition. Then erase the old harddive and extend the lvm across both drives. Plenty of room for backups.
Problem right off the back. Centos doesn't support xfs. hda6 is formated as xfs. Dapper drake cd worked fine. Boot off it like a live cd. Heres the commands I did.
mkdir /server
mkdir /server-old
lvscan
#lvscan showed the output I needed to mount it. See lvm is logical volume management. I don't have the notes I used to create it but this is how it works.
pvcreate a physical partition like /dev/hda6. Then vgcreate and add it to a volume group. From there you use lvcreate to create a logical volume and format it. This case it would've been mkfs.ext3 /dev/server/server
mount /dev/server/server /server
mount /dev/hda6 /server-old
#Check to make sure I have enough space.
df -h
#df shows that /dev/hda6 is using about 182G so I needed to extend my logical volume cause it was only a 100G
lvextend -L +100G /dev/server/server
#Then extend the filesystem
#Dapper doesn't have the e2fsadm so reboot
reboot
e2fsck -f /dev/server/server
resize2fs /dev/server/server 200G
mount /dev/server/server /server
#Check space once more
df -h
#Back into Dapper
reboot
#switch to a virtual console and then to runlevel 1 so the x server isn't running. Start screen incase this thing dies for some odd reason
ctrl+alt+f1
sudo -i
init 1
screen
mkdir /server; mount /dev/server/server /server
mkdir /old; mount /dev/hda6 /old
#Sync the old to the new. a preserves a lot of stuff like permissions it's called archive and the v is verbose. It'll least each file being copied.
rsync -av /old /server
I let that run overnite and to be safe I ran the command again this morning. There were no changes I rebooted to get back into Centos.
#Now to erase the partition table for the old harddrive and create one big one. Don't forget to change the id to 8e for Linux LVM.
fdisk /dev/hda
#Partprobe to update the kernel of partition changes
partprobe
#Now set that partition up and extend the lvm onto it.
pvcreate /dev/hda1
vgextend server /dev/hda1
vgdisplay
lvextend -L +54G /dev/server/server
#I left 200G if I wanted to create a new lv. I can always extend this one if it's needs the space. It's easier to extend then reduce lvms.
e2fsck -f /dev/server/server
resize2fs /dev/server/server 254G
#Credits
Couldn't remember how to extend a ext3 filesystem but found it here
http://wiki.centos.org/TipsAndTricks/ResizeExt3
My server orginally was running Ubuntu Breezy Badger. I liked ubuntu but too many problems started happening. When I added a new harddrive I figured it was time to update to dapper or maybe even edgy. Those were even worse then breezy. Hence the switch to centos. Might as well put that RHCT to use.
A little about the partitioning scheme the server is using for this migration. Theres two harddrives each 250gb.
/dev/sda5 is the new LVM partition. The goal is to move the data from /dev/hda6 onto the new lvm parition. Then erase the old harddive and extend the lvm across both drives. Plenty of room for backups.
Problem right off the back. Centos doesn't support xfs. hda6 is formated as xfs. Dapper drake cd worked fine. Boot off it like a live cd. Heres the commands I did.
mkdir /server
mkdir /server-old
lvscan
#lvscan showed the output I needed to mount it. See lvm is logical volume management. I don't have the notes I used to create it but this is how it works.
pvcreate a physical partition like /dev/hda6. Then vgcreate and add it to a volume group. From there you use lvcreate to create a logical volume and format it. This case it would've been mkfs.ext3 /dev/server/server
mount /dev/server/server /server
mount /dev/hda6 /server-old
#Check to make sure I have enough space.
df -h
#df shows that /dev/hda6 is using about 182G so I needed to extend my logical volume cause it was only a 100G
lvextend -L +100G /dev/server/server
#Then extend the filesystem
#Dapper doesn't have the e2fsadm so reboot
reboot
e2fsck -f /dev/server/server
resize2fs /dev/server/server 200G
mount /dev/server/server /server
#Check space once more
df -h
#Back into Dapper
reboot
#switch to a virtual console and then to runlevel 1 so the x server isn't running. Start screen incase this thing dies for some odd reason
ctrl+alt+f1
sudo -i
init 1
screen
mkdir /server; mount /dev/server/server /server
mkdir /old; mount /dev/hda6 /old
#Sync the old to the new. a preserves a lot of stuff like permissions it's called archive and the v is verbose. It'll least each file being copied.
rsync -av /old /server
I let that run overnite and to be safe I ran the command again this morning. There were no changes I rebooted to get back into Centos.
#Now to erase the partition table for the old harddrive and create one big one. Don't forget to change the id to 8e for Linux LVM.
fdisk /dev/hda
#Partprobe to update the kernel of partition changes
partprobe
#Now set that partition up and extend the lvm onto it.
pvcreate /dev/hda1
vgextend server /dev/hda1
vgdisplay
lvextend -L +54G /dev/server/server
#I left 200G if I wanted to create a new lv. I can always extend this one if it's needs the space. It's easier to extend then reduce lvms.
e2fsck -f /dev/server/server
resize2fs /dev/server/server 254G
#Credits
Couldn't remember how to extend a ext3 filesystem but found it here
http://wiki.centos.org/TipsAndTricks/ResizeExt3
Subscribe to:
Posts (Atom)