All the key switch does is turn on or off the ability to run the starter motor and glow plugs. This allows you to take the key out and maybe keep the little kids from messing with your tractor. But your diesel tractor will start with the key switch off if you turn the engine over some other way, like pull starting it, if the "throttle" lever is in the right position. It is also extremely easy to "hot wire" the diesel electric start system with a screwdriver or pair of pliers.
The way to turn off the diesel engine is to push the "throttle" lever as far up as it will go. You will want to turn off the key switch though, because if you don't your battery will go dead. Been there, done that!