Z4Root is a free rooting program that – unlike other software – doesn’t require users to connect their Android to a computer. Note that this app is only applicable to devices running Android 2.2 and lower.
Note: This tag is close to obsolete as the rooting method mentioned is only for devices from Android 2.1 to 2.2.
From the official post on XDA:
Froyo (Android 2.2) is a bit of a pain to root! Well, this fixes that.
Sebastian Krahmer's rageagainstthecage
What this does
It is an app you install from the market or by side loading, that has a single button that will root your device.
How safe is this?
Should be 100% safe - nothing on disk is changed besides the root binaries, so if something goes wrong, simply rebooting the device should fix up any and all issues.
The new temporary root option works on 99% of available Android devices - no list yet of which specific devices are incompatible with the temporary root option - I am still trying to find out.
Here is the list so far of known compatible and incompatible devices for the permanent root option. I haven't actually tested these myself - I only have a Galaxy S device - but this list has been created by reports from users.
Compatible with PERMANENT root option
Samsung Galaxy S (All variants)
Galaxy 3 I5800
Cricket Huawei Ascend
Garmin Asus A50
Motorola Milestone 2
X10 Mini Pro
Smartq v7 android 2.1
Incompatible with PERMANENT root option
Desire (requires nand unlock)
Desire HD (requires nand unlock)
Evo (requires nand unlock)
G2 (requires nand unlock)
Archos 70 (unknown)
myTouch 3G (unknown)