Image source: Getty Images.

ITT Technical Institute, one of the nation's best-known for-profit colleges, recently shut its doors amid a federal investigation alleging shaky finances and shady recruiting tactics. While critics of the school have cheered the move, it also left more than 40,000 students scrambling to figure out what to do next -- and whether they're still on the hook for their student loans.

Fortunately for those students, the answer is probably no. As long as they don't transfer their credits and continue their studies at another school, they're probably eligible for a federal student loan discharge because their school closed. That's right: Uncle Sam may have a heart after all.

But for debt-saddled students of other institutions, the ITT Tech debacle raises a larger question: How hard is it to walk away from your federal student loan? Almost a quarter of millennials think they know the answer: In a recent survey by PricewaterhouseCoopers and Junior Achievement USA, 24% said they think their loans will be forgiven.

Is this just a case of unfounded millennial optimism, or are the youngsters on to something? Let's look at the reasons you may be let off the hook without repaying some or all of your federal student loans, and whether the same holds true for private student loans.

Federal student loans: Improbable, but not impossible

To walk away from your federal student loan, you must be eligible for one of three actions: forgiveness, discharge, or cancellation.

  • Forgiveness is the best option for most borrowers: You devote your time and energy to something the government finds valuable, and in exchange, you don't have to repay your remaining loan balance. Forgiveness programs are available for some teachers at low-income schools and workers in many public-service jobs. The major catch? You must have already made at least 120 qualifying monthly payments.
  • Discharge is reserved for a set of bad circumstances that are beyond your control. You may be eligible if your school closes while you're enrolled or shortly after you withdraw, if you become totally and permanently disabled (yikes), if you die (gulp), or if you declare bankruptcy and prove that repayment would cause undue financial hardship. You may also be off the hook if your school engaged in shady practices such as falsely certifying your eligibility, forging your signature on the promissory note, or not paying back a refund it owed your lender after you withdrew.
  • Cancellation is reserved for borrowers with low-interest, need-based federal Perkins loans. Qualifying reasons are a mishmash of those discussed: You become permanently disabled or die, you declare bankruptcy and prove repayment would cause undue hardship, your school closes, or you work in certain public-service careers. You may also qualify by serving as a member of the armed forces in combat areas.

Each of these options requires borrowers to meet a specific set of criteria, and it's important to note that not every kind of loan will qualify. Under some circumstances, loans that do qualify may not be forgiven or canceled in full. In other words, Uncle Sam will really make you work for this, so make sure you read all the fine print before toasting his generosity.

Private student loans: Good luck with that

Private student loan forgiveness and cancellation don't really exist. Yes, some lenders will discharge your loans if you become permanently disabled or die, but those are hardly palatable options.

Also note the word "some": Private lenders don't even have to discharge loans upon disability or death, and many don't. For instance, if you die, they may expect your estate to pay up, and if there was a co-signer (which is common among private loans), that person will still be expected to pay. And some private lenders will automatically put a loan into default if your co-signer dies, requiring you to immediately pay the whole balance.

Bottom line: Those private student loans aren't going anywhere. You may be able to find some relief by negotiating lower or more flexible payments, refinancing to secure a lower interest rate, or even postponing payments under certain circumstances. But you're at the mercy of your lender, and interest will keep piling up regardless.