Don't overcook it. Put your eggs into boiling water, simmer for 9 minutes and then refresh in cold water until the egg is cold. Voila perfect hard boiled eggs. Personally I cook them as above for about 8 minutes as i like the egg yolk cooked but nice and orange.
The green you describe is the metals in the yolk that are drawn toward the heat. By putting the egg in cold water, it moves those minerals back inside the yolk rather than have them collected at the edge.