"If Linux is open source software, which means that all its source code is available on the internet, this means that all the bad guys (crackers) over there on the internet can see its inner code and may discover any weaknesses on the OS's code and exploit that weakness for their benefits. Then how you are telling us that Linux is a secure OS?"
This is an interesting question - pretty common one in the line in teaching security. But I find that last question is something of a hasty generalization fallacy. Just because people can find new an interesting exploits to a system doesn't mean it's not a secure OS. Any lock can be picked or broken with sufficient will, time, and resources.
If they want a classic answer, assign your students to read Sun Tzu's Art of War as a reading assignment.
There are four security principles that come into play that I've taught in classes before:
1) Security through Obscurity is not Security at all
2) Open Disclosure is Good for Security
3) There is no such thing as absolute security; there are no silver bullets.
4) Security is a function of proper risk management.
I would start also with the opposite question - Microsoft Windows Server is a closed source operating system. But yet, it has been the target of many attacks. So being open or closed really isn't going to come into play - everyone is a target - MSFT, Linux, Apple...all of them are targets.
Next, I would raise the point that while exploits of code are why systems end up compromised, compromises are far more the case through the user. So it really doesn't matter what OS it is - if I can beat the user, the system security is irrelevant, in the long run.
Then, going back to my two points, yes, the bad guys are going to pour over OS code looking for holes. Doesn't matter if it's Linux or something else - never underestimate a properly motivated attacker. But when code is open, it also gets the good guys seeing it too. Now zero-day threats are a real thing and always will be, regardless of system. When a Zero Day comes out, regardless of OS, there are firms all over it, working up a patch.
Interestingly, in February, Google announced bigger bug bounties for exploits to Linux and Kubernetes. So in that, our attackers are now more apt to pen-test for the payoff, rather than to attack others. Threats are out there still. As a matter of fact, this week marked a year since I got to come toe-to-toe with the Kasaya ransomware hack from Russian group REvil.
In short, it's a cat and mouse game. Build a better mousetrap, get better mice. It's a revolving process. The cost, though, as we all know...
...is constant vigilance.
Close the discussion with a challenge - are you willing to stand in the gap and defend your network?
Because that's what it takes.
/r