Sunday, March 26, 2006

chkrootkit

A rootkit is a set of software tools frequently used by a third party (usually an intruder) after gaining access to a computer system. These tools are intended to conceal running processes, files or system data, which helps an intruder maintain access to a system without the user's knowledge. Rootkits are known to exist for a variety of operating systems such as Linux, Solaris and versions of Microsoft Windows. A computer with a rootkit on it is called a rooted computer.
- from Wikipedia


So, for the paranoid:
chkrootkit is a tool to locally check for signs of a rootkit.

Installation is a simple
# apt-get install chkrootkit
and then run it with # chkrootkit

Preventing SSH Dictionary Attacks With DenyHosts

Preventing SSH Dictionary Attacks With DenyHosts | HowtoForge - Linux Howtos and Tutorials: "DenyHosts is a tool that observes login attempts to SSH, and if it finds failed login attempts again and again from the same IP address, DenyHosts blocks further login attempts from that IP address by putting it into /etc/hosts.deny. "

Saturday, March 25, 2006

checking and repairing file system with fsck

fsck is a Unix utility for checking and repairing file system inconsistencies . File system can become inconsistent due to several reasons and the most common is abnormal shutdown due to hardware failure , power failure or switching off the system without proper shutdown . Due to these reasons the superblock in a file system is not updated and has mismatched information relating to system data blocks, free blocks and inodes .

fsck should always be run in a single user mode which ensures proper repair of file system . If it is run in a busy system where the file system is changing constantly fsck may see the changes as inconsistencies and may corrupt the file system .

- from checking and repairing file system with fsck

More Links:
Fsck - Wikipedia, the free encyclopedia
Check Disk
Experts-Exchange Answer

Setting up SSH and FTP with SSH

The simplest setup i've had so far! Just Install, Configure and Start it!

Get OpenSSH:
http://www.openssh.com/

Install OpenSSH:
# apt-get install openssh

Secure It:
Config file location: /etc/ssh/sshd_config

Change to the more secure SSH Version 2 in the config file.
Protocol 2

Start/Stop/Restart Commands:
# /etc/init.d/sshd start
# /etc/init.d/sshd stop
# /etc/init.d/sshd restart

Test if running:
# pgrep sshd
You should get a response of a process ID

Thats it!
To login from a remote machine you need to use an SSH client like PuTTY.
Here's a list of clients that you could use:
http://en.wikipedia.org/wiki/List_of_SFTP_clients

To login from a client type ssh followed by the IP of the SSH server.
e.g. ssh 192.168.0.0

What To Expect With Your First Login
The first time you log in, you get a warning message saying that the remote host
doesn't know about your machine and prompting you to store a copy of the remote
host's SSH identification keys on your local machine. It will look something
like this:

[root@bigboy tmp]# ssh smallfry
The authenticity of host 'smallfry (smallfry)' can't be established.
RSA key fingerprint is 5d:d2:f5:21:fa:07:64:0d:63:1b:3b:ee:a6:58:58:bb.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'smallfry' (RSA) to the list of known hosts.
root@smallfry's password:
Last login: Thu Nov 14 10:18:45 2002 from 192.168.1.98
No mail.

[root@smallfry tmp]#

- from: Quick HOWTO: Secure Remote Logins And File Copying

Read up about SSH and Tutorial Links:
http://www.openssh.com/
Quick HOWTO: Secure Remote Logins And File Copying

Tuesday, March 14, 2006

Syncing an iPaq Pocket PC with SuSE 10

Ok.. I took the long route.. I got the iPaq to work with synce and then realised that I needed to get it to work with synce-kde and raki. Eitherways Ive documented what I did.. what went wrong and what I did again! Theres a whole load of instructions and how-tos at synce.sourceforge.net that actually work..

PART A: Working with synce
Worked with instructions from here

1. Check Kernel.. Version 2.6 and above is good
# uname -r
2.6.13-15.8-default


2. Before you plugin the iPaq.
# cat /proc/bus/usb/devices > /tmp/before

3. Plugin the iPaq.
# cat /proc/bus/usb/devices > /tmp/after

4. Check USB settings now..
# diff /tmp/before /tmp/after
55a56,63
> T: Bus=03 Lev=02 Prnt=03 Port=03 Cnt=02 Dev#= 10 Spd=12 MxCh= 0
> D: Ver= 1.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=16 #Cfgs= 1
> P: Vendor=03f0 ProdID=1016 Rev= 0.00
> C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 50mA
> I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff
Driver=ipaq
> E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
> E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
>

If the stuff in bold is different on your machine (besides the vendor and
prodID, refer to this HOWTO...

5. Make sure the iPaq is 'ON'..
# synce-serial-config ttyUSB0

6. You can now start a serial connection.
# synce-serial-start
Works? great.. Terminate it.. (kill it or ctrl+C)

NOTE: SynCE requires the following TCP ports to be open in the firewall between
your PC and the PDA:
From PDA to PC: 5678 & 5679
From PC to PDA: 990


7. Now unplug the PPC, run the next command and plug it back in.
NOTE: The 'dccm' command should be run before the device is pluged in and it should be run as a user NOT root:
~> dccm

8. Now as root:
# synce-serial-start

At first try I got no response since I had run the dccm command while the PPC was plugged in. When i pressed ctrl-c i got..
Connect script failed synce-serial-start was unable to start the PPP daemon!

And in var/logs/messages i found:
Mar 13 19:31:20 sorceress synce-serial-start: Executing '/usr/sbin/pppd call synce-device'
Mar 13 19:31:20 sorceress pppd[6973]: pppd 2.4.3 started by wraith, uid 0
Mar 13 19:31:25 sorceress pppd[6973]: Connect script failed
Mar 13 19:31:25 sorceress pppd[6973]: Exit.


So I closed the connection..
Before you unplug the cable you should do one of these actions, in order of preference:
1. Disconnect with the GNOME Tray Icon or with SynCE-KDE
2. Disconnect with the appropriate action on your PDA
3. Run killall -HUP dccm from the command line
4. Run synce-serial-abort.

I setup ActiveSync on PPC by checking the boxes for syncing with a remote PC.

Did a lil debugging by unplugging the PPC and running (as User)
~> dccm -f -d 4 (this shows whats going on by running dccm in the foreground)

Plugged in PPC.. ran (as root)
# synce-serial-start

Tapped ActiveSync's 'Sync' on PPC.

Got dccm output
dccm[7856]: Talking to 'Solitude', a PocketPC device of type hp iPAQ h1940
dccm[7856]: Running command: /home/wraith/.synce/scripts/dccm.sh connect

This means its connected!! Woo Hoo!

9. To check connection run the pstatus command and it'll print the details of your PPC
~> pstatus

Version
=======
Version: 4.20.1081 (Ozone: Pocket PC 2003 (?))
Platform: 3 (Windows CE)
Details: ""

System
======
Processor architecture: 5 (ARM)
Processor type: 2577 (StrongARM)
Page size: 0x10000

Power
=====
ACLineStatus: 01 (Online)

Status for main battery
=========================
Flag: 1 (High)
LifePercent: 100%
LifeTime: Unknown
FullLifeTime: Unknown

Status for backup battery
=========================
Flag: 1 (High)
LifePercent: 100%
LifeTime: Unknown
FullLifeTime: Unknown

Store
=====
Store size: 29630464 bytes (28 megabytes)
Free space: 23082084 bytes (22 megabytes)

Memory for storage: 29704192 bytes (28 megabytes)
Memory for RAM: 29704192 bytes (28 megabytes)


Works: Now to sync data!

10. Create a partnership:
~> synce-matchmaker create

Since i already had 2 partnerships I got an error You can check existing partherships with:
~> synce-matchmaker status
Current partner index: 1
Partner 1 id: 0x3151e3b1
Partner 1 name: "sorceress"
Partner 2 id: 0x580d0639
Partner 2 name: "DRUIDESS"


And then replace a partnership
~> synce-matchmaker replace 1
Partnership replacement succeeded.


PART B: Working with synce-kde and raki

The HOW-TO: Installing SynCE for KDE from binary packages

1. Get the synce-kde-pack rpm from the link above and install. Dont forget to uninstall synce-kde since it causes conflicts.
Dependencies:
kdebase3 >= 3.5 is needed by synce-kde-pack-0.9.1-6
kdepim3 >= 3.5 is needed by synce-kde-pack-0.9.1-6
kdepim3-sync >= 3.5 is needed by synce-kde-pack-0.9.1-6

Yeah, had to upgrade KDE and it made a lot of changes on my system.. still climing out of that blast.. but on the bright side i got the syncing to work!

2. The next HOW-TO: Basic configuration of SynCE for KDE

3. Start raki (check the KMenu for it), choose vdccm instead of dccm.

4. As root run
synce-serial-start

5. Your see raki perkup and follow the onscreen instructions... check the HowTo for kewl stuff raki can do for you..

6. About the syncing.. I can sync my contacts into kaddressbook via raki using a .vcf file. Just fish around rakis options and you'll find it.. Im still working on this bit. Evolution looks good for a PIM but theres too many dependancies to get it to work.. So im trying to work with kde's defaults..

Now on to getting my Nokia to sync with suse 10.0.. :)

Saturday, March 11, 2006

Linux (washing powder) - Wikipedia, the free encyclopedia

Linux (washing powder) - Wikipedia, the free encyclopedia

Installing Logitech QuickCam Webcam

I first tried the latest version 1.1 of the qc-usb driver but I kept getting errors. /dev/video0 would not load. I kept getting an error from the ./quickcam.sh line 699 and other such things. After trying various things I deleted the installation folder, restarted the computer and decided to try an older version of the qc-usb driver. I tried qc-usb-0.6.3 and the cam worked on the first try! Heres the walkthrough...

1. Make sure the RIGHT kernel sources are installed.

a. Check the kernel version number.
cat /proc/version
Output on my system:
Linux version 2.6.13-15.8-default (geeko@buildhost) (gcc version 4.0.2
20050901 (prerelease) (SUSE Linux)) #1 Tue Feb 7 11:07:24 UTC 2006


b. Check if source is installed
rpm -qa kernel*

On my system this returns:
kernel-default-nongpl-2.6.13-15.8
kernel-update-tool-0.9-10
kernel-default-2.6.13-15.8
kernel-source-2.6.13-15.8

Note the line kernel-source.

2. Setup Kernel Sources:

a. Execute the following as root:
cp /usr/src/linux-2.6.13-15.8-obj/i386/default/.config /usr/src/linux/.config
cp /usr/src/linux-2.6.13-15.8-obj/i386/default/scripts/mod/modpost /usr/src/linux/scripts/modpost
cp /usr/src/linux-2.6.13-15.8-obj/i386/default/scripts/genksyms/genksyms /usr/src/linux/scripts/genksyms/genksyms
cp /usr/src/linux-2.6.13-15.8-obj/i386/default/scripts/basic/fixdep /usr/src/linux/scripts/basic/fixdep
cp /usr/src/linux-2.6.13-15.8-obj/i386/default/scripts/mod/modpost /usr/src/linux/scripts/mod/modpost

b. You also need to put Module.symvers into the right place.
cp /boot/symvers-2.6.13-15.8-i386-default.gz /usr/src/linux
mv symvers-2.6.13-15.8-i386-default.gz Module.symvers.gz
gunzip /usr/src/linux/Module.symvers.gz
make modules_prepare


3. You need a working installation of gcc >= 2.95

4. Get qc-usb: Logitech QuickCam USB Video Camera driver

5. Install xawtv - Video4Linux TV application (Athena)

6. Run the installation (not as Root) and follow on screen instruction. Here if I didnt specify the location of my kernel sources the script kept complaining.
./quickcam.sh LINUX_DIR=/usr/src/linux

Thats it...

You can use ./qcset to configure the cam..

Check out this link for more info on the installation on SuSE 10.0:
http://www.novell.com/coolsolutions/feature/16340.html
The first section describes how to ready the machine for the installation and the second section is for installation of the Logitech Zoom Cam..

Wednesday, March 8, 2006

Setup Subversion on the Apache HTTP server

-EDIT-
For a easy mini how-to for setting up Apache2 with SVNis see /usr/share/doc/packages/subversion for the full documentation. Is easier than what's below, but i'll leave the info below for info sake...
-EDIT-

Setup Subversion on the Apache HTTP server

Changes to http.conf

LoadModule dav_module /usr/lib/apache2/mod_dav.so
LoadModule dav_svn_module /usr/lib/apache2/mod_dav_svn.so

#Subversion Repository
< Location /blabbermouth >
DAV svn
SVNPath /usr/svnrepos

# how to authenticate a user
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/svn-auth-file

# For any operations other than these, require an authenticated user.
< LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>


Make Changes in subversion's /conf/passwd file to allow read/write/none access..

[/]
* = r
[blabbermouth:/]
user1=rw
user2=rw

Allows anyone to read ALL repositories and user1 and user2 to write to the 'blabbermouth' repository.

Remeber to give the UserID that Apache runs as permission to write to your svn folder. If your svn repos is owned by a user 'svn' and group 'snv' and if Apache runs as 'wwwrun' (check the httpd.conf or uid.conf) then in the console type:
# groups wwwrun to list the groups that wwwrun belongs to.
# usermod -G svn wwwrun will add wwwrun to the svn group. if 'wwwrun' belongs to anyother groups (besides the primary group 'www') then mention them alongside svn.

Tuesday, March 7, 2006

Subversion

The goal of the Subversion project is to build a version control system that is a compelling replacement for CVS in the open source community.
Get it here: Subversion

SVNForum.org is a Subversion community help and discussion forum for exchanging information and tips with other users of Subversion

Read The Subversion Book for instrustions.

And if you use windows get TortoiseSVN, a Subversion client, implemented as a windows shell extension. The coolest Interface to (Sub)Version Control.

note to self:
Create SVN repository:
svnadmin create --fs-type fsfs /usr/svnrepos/

Import to SVN:
svn import --message "Initial Import" repos file:///usr/svnrepos/blabbermouth/

Wednesday, March 1, 2006

Angels and "Daemons"

While I try and figure out the startup scripts for Slimserver.. here's how to run it as a daemon..
/usr/local/slimserver/slimserver.pl --daemon

ahh!! finally i can close that command prompt... :)

Stream Your Music Collection over the Web Hack

Amazing what a simple search can lead to!! Out of the blue popped....
Stream Your Music Collection over the Web Hack

Works on Windows, Linux and Mac.
You will need:
The SlimServer: The server.

SoftSqueeze: A Java client.

There are a couple of ways to stream the music to your PC with SlimServer - you can either use SoftSqueeze (the installation of which is nicely documented inside the interface), running either as a standalone Java application, or as a Java Applet (by going to http://your_host_name:9000/html/softsqueeze/applet.html ).

You can use winamp as a client to stream music on if you'd like... Use the URL: http://your_host_name:9000/stream.mp3 If you are using the SlimServer's password security, you'll need to use a slightly modified URL like this: http://username:password@your_host_name:9000/stream.mp3

Muhahahhahahaha!!!!!!

--- Still figuring out the startup script for suse 10.0

MySQL Server over the network - Linux Forums

MySQL Server over the network - Linux Forums
Error 1130, remote connecting access denied.
MySQL and Linux Tutorial

To allow network access:
GRANT ALL on * TO 'username' IDENTIFIED BY 'user password'
FLUSH PRIVILEGES


Some notes on the MySQL/Java connection with the MySQL® Connector/J (mysql-connector-java).
After installing it you need to change the CLASSPATH or you'l get errors like com.java.driver something not found..
For the bash shell prompt that I use in SuSE 10.0 I created a file in my home dir: .bashrc

~username/.bashrc
---------------------
export CLASSPATH=$CLASSPATH:/opt/mysql-connector-java-3.1.12/mysql-connector-java-3.1.12-bin.jar

**make sure its one line, with no line breaks in it!
Info for other Shell prompts