Hi, greenelephantscarf. Yes, I'm a retired Fed.
how does the shut down work for the government employees?
Some sit at home on furlough, others are deemed 'essential' (that was me) and are required to work with no pay and no promise of being paid when it's all over. We 'essentials' always got back-paid, but what was so frustrating was that so did those who weren't required to work!
if they don't get paid, are they allowed to get second jobs?
Yes, subject to the usual rules. The job can not be a conflict of interest with your current job, for instance, a Dept of Defense employee couldn't accept a job from a DoD Contractor. For an 'essential' it can't conflict with your regular hours, nor render you incapable of working (ie take a job that kept you up all night so you aren't fit for duty).
can they get insured against loss of income in such a situation?
Most US States have some type of unemployment insurance. Furlough is the same as being laid off so a furloughed Fed would qualify depending on the State's rules. They do in California (where I live). Problem is that the payment rates are really low compared to salary, about 60% of your weekly wage. And it must be paid back if you get back pay.