hardware overview: P4 3.2, 1.5Gb RAM. 1 25Gb hard drive, 2 1.5Tb hard drives.
the two 1.5 Tb drives are mounted as \home\user\primary_storage and \home\user\secondary_storage
The are NOT configured as RAID intentionally. A cron script syncs them and does md5 hashes.
notation convention: <user> is the name you use
$ sudo apt-get install gparted
formatted both 1.5 Tb hard drives as ext3
following http://www.psychocats.net/ubuntu/mountlinux
$ mkdir /home/<user>/primary_storage
$ mkdir /home/<user>/secondary_storage
make a backup of the list of disks
$ sudo cp /etc/fstab /etc/fstab.original
list what drives are recognized
$ sudo fdisk -l
$ sudo gedit /etc/fstab
/dev/sdb1 /home/<user>/primary_storage ext3 defaults 0 0
/dev/sdc1 /home/<user>/secondary_storage ext3 defaults 0 0
next, mount all available partitions in fstab:
$ sudo mount -a
sudo mount -t ext3 /dev/sdb1 /media/sdb1
Finally, change permissions, since by default they are root only
$ sudo chown -R <user>:<user> /home/<user>/primary_storage
$ sudo chown -R <user>:<user> /home/<user>/secondary_storage
$ sudo chmod -R 755 /home/<user>/primary_storage
$ sudo chmod -R 755 /home/<user>/secondary_storage
software overview: using ubuntu as host, virtualbox runs guest ubuntus and windows XP Pro SP3
Howto VirtualBox 2.1 in Ubuntu 8.10: http://ubuntuforums.org/showthread.php?t=1015045
workstations:
Windows gaming
serious sam
quake III arena
ubuntu work
gfortran
mathcad, matlab, mathematica, maple, gnuplot
latex
windows test
ubuntu test
Initially I had 2Gb of RAM. Then I ran into some errors. I thought it was my hard drive, an
ancient 25 Gb model, from back when that was top of the line.
hard drive bad blocks:
http://ubuntu-rescue-remix.org/node/50
http://ubuntumagnet.com/2008/01/checking-disks-errors-using-badblocks-command
$ sudo badblocks -s -v -c 10240 /dev/sdx
[took 30 minutes for 25Gb hard drive.]
Checking blocks 0 to 23912720
Checking for bad blocks (read-only test): done
Pass completed, 0 bad blocks found.
Decided not to do a hard drive recover, as only 2 days were invested with the 25Gb hard drive
http://blogs.sun.com/superpat/entry/hard_drive_recovery_ubuntu_style
Then decided it may be the filesystem and not the hardware. Did fsck.
sudo e2fsck -C0 -p -f -v /dev/sda1
https://help.ubuntu.com/community/SystemAdministration/Fsck
Still getting errors, so did memtest off a knoppix LiveCD. The fourth 512Mb was
bad, so removing it was the solution.
Dual screen monitors, one 22" widescreen, one 17" 4:3. ATI RADEON 9600 with
the proprietary drivers. Two issues: reconfiguring to a left-right set up instead of the default
"mirroring" option works, but
changes don't stick after logoff/logon or reboots
both monitors must be same resolution. This screws the 17" 4:3 and 22" 16:9 combination
Firefox config: using FEBE, transfered all firefox settings from old windows workstation
to new Ubuntu
Next up: the virtualbox cloning (2.1.0r41146)
Installed newest vbox using sudo-apt get. Used the non-open source version
as I need USB drivers.
Changed the default virtualdisk image directory and machine directories to point
to \home\user\primary_storage\vdi, otherwise the large files would have been
on the
once a guest machine is set up, I wanted to have backups of the fresh installs.
$ VBoxManage clonevdi <source>.vdi <destination>.vdi
vbox said it worked (took a while), but when I set up a new guest and used the
cloned vdi, I got " a disk read error occurred"
http://ubuntuforums.org/showthread.php?t=1022778
in Windows, while Ubuntu guests just hung at the GRUB load.
clonehd didn't work either, so I ended up finding
cp <source>.vdi <destination>.vdi
$ VBoxManage internalcommands setvdiuuid <destination>.vdi
Once my data has been migrated to primary_storage, I run md5sum
on everything. md5sum isn't recursive, so there are replacements like
http://md5deep.sourceforge.net/
but a small shell script ("one line") does the same:
find . ! -type d -print0 | xargs -0 md5sum
or
find . -type f -exec md5sum {} \;
off-site backups:
http://www.gnu.org/savannah-checkouts/non-gnu/rdiff-backup/
Moving SSH to a different port:
$ sudo gedit /etc/ssh/sshd_config
Port 22
becomes
Port 1022
$ sudo /etc/init.d/ssh restart
Then do
$ ssh -p 1022 -X user@<IP>
for ssh or
$ scp -P 1022 user@<IP> .
for scp
SSH Tarpit for pesky port scanners [I can't get this to work yet]
https://lists.ubuntu.com/archives/ubuntu-users/2007-July/119286.html
http://kindergarten.madduck.net/configs/iptables
http://lists.netfilter.org/pipermail/netfilter/2005-June/060914.html
what existed:
user@ubunturesearch:~$ ls /proc/net/
anycast6 igmp ipv6_route psched snmp tr_rif
arp igmp6 mcfilter ptype snmp6 udp
atm ip6_flowlabel mcfilter6 raw sockstat udp6
connector ip_mr_cache netfilter raw6 sockstat6 udplite
dev ip_mr_vif netlink route softnet_stat udplite6
dev_mcast ip_tables_matches netstat rt6_stats stat unix
dev_snmp6 ip_tables_names packet rt_acct tcp wireless
if_inet6 ip_tables_targets protocols rt_cache tcp6
user@ubunturesearch:~$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
user@ubunturesearch:~$ sudo apt-get install ssh
user@ubunturesearch:~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
user@ubunturesearch:~$ sudo iptables --append INPUT -i eth0 --proto tcp --match tcp --dport 22 --match conntrack --ctstate NEW -m recent --set --name sshscans --rsource
user@ubunturesearch:~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
tcp -- anywhere anywhere tcp dpt:ssh ctstate NEW recent: SET name: sshscans side: source
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
user@ubunturesearch:~$ ls /proc/net
anycast6 ip_conntrack netfilter route tcp6
arp ip_conntrack_expect netlink rt6_stats tr_rif
atm ip_mr_cache netstat rt_acct udp
connector ip_mr_vif nf_conntrack rt_cache udp6
dev ip_tables_matches nf_conntrack_expect snmp udplite
dev_mcast ip_tables_names packet snmp6 udplite6
dev_snmp6 ip_tables_targets protocols sockstat unix
if_inet6 ipt_recent psched sockstat6 wireless
igmp ipv6_route ptype softnet_stat
igmp6 mcfilter raw stat
ip6_flowlabel mcfilter6 raw6 tcp
user@ubunturesearch:~$
user@ubunturesearch:~$ ls /proc/net/ipt_recent/
sshscans
user@ubunturesearch:~$ sudo iptables -A INPUT -p tcp -m tcp -m recent --rcheck --seconds 60 --hitcount 1 --name sshscans --rsource -j TARPIT
iptables: No chain/target/match by that name
user@ubunturesearch:~$ sudo iptables -A INPUT -p tcp -m tcp --dport 22 -m recent --rcheck --seconds 3600 --name sshscans --rsource -j TARPIT
iptables: No chain/target/match by that name
*************
Turns out the default Ubuntu kernel doesn't support TARPIT.
$ sudo apt-get install labrea
but labrea is for setting up a virtual network to slow down scans by worms, not specifically SSH.
http://www.howforge.com/how-to-install-patch-o-matic-in-ubuntu (2006)
http://enterprise.bih.harvard.edu/pub/tarpit-updates/
to see which kernel you have,
$ uname -a
Linux 2.6.27-11-generic (2009)
$ iptables -V
iptables v1.4.0
*****************
sudo fsck /dev/sdb1
sudo fsck /dev/sdc1