You did the right thing. Yelling stop and surprising him would have been bad. Talk to him and explain proper safety procedures to him. You may also want to talk to your safety team and make sure they are talking to all of the machinists about proper procedures. That could be a lawsuit waiting to happen. It's one thing if a worker bypasses safety devices or ignores procedures. It's another matter altogether if he is not told about workplace safety at all and doesn't know any better.
Agreed. Worst thing to do is distract him. I would have handled just as you did. Best to hope and pray that you can discuss it later with him. Change your company policy so no one ever starts working with equipment they have not been trained on. Its just not worth the risk.