"Once upon a time, monks, a hard-shelled tortoise was foraging for food in the evening along the shore of a lake. And a jackal was also foraging for food in the evening along the shore of the lake. The tortoise saw the jackal from afar, foraging for food, and so — withdrawing its four legs, with its neck as a fifth, into its own shell — it remained perfectly quiet and still. But the jackal also saw the tortoise from afar, foraging for food, and so it went to the tortoise and, on arrival, hovered around it, [thinking,] "As soon as the tortoise stretches out one or another of its four limbs — or its neck as a fifth — I'll seize it right there, tear it off, and eat it." But when the tortoise didn't stretch out any of its four limbs — or its neck as a fifth — the jackal, not having gotten any opportunity, lost interest and left.
"In the same way, monks, Mara is continually, ceaselessly, hovering around you, [thinking,] 'Perhaps I'll get an opportunity by means of the eye... the ear... the nose... the tongue... the body. Perhaps I'll get an opportunity by means of the intellect.' Thus, monks, you should dwell with the doors to your senses well-guarded.
"On seeing a form with the eye, do not grasp at any theme or details by which — if you were to dwell without restraint over the faculty of the eye — evil, unskillful qualities such as greed or distress might assail you. Practice for its restraint. Guard the faculty of the eye. Secure your restraint with regard to the faculty of the eye.
"On hearing a sound with the ear...
"On smelling an aroma with the nose...
"On tasting a flavor with the tongue...
"On touching a tactile sensation with the body...
"On cognizing an idea with the intellect, do not grasp at any theme or details by which — if you were to dwell without restraint over the faculty of the intellect — evil, unskillful qualities such as greed or distress might assail you. Practice for its restraint. Guard the faculty of the intellect. Secure your restraint with regard to the faculty of the intellect.
"When you dwell with the doors to your senses well-guarded, Mara, not getting any opportunity, will lose interest and leave, just as the jackal did with the tortoise."
See also: SN 1.17