官术网_书友最值得收藏!

The dangers of logging in as the root user

A huge advantage that Unix and Linux operating systems have over Windows is that Unix and Linux do a much better job of keeping privileged administrative accounts separated from normal user accounts. Indeed, one reason that older versions of Windows were so susceptible to security issues, such as drive-by virus infections, was the common practice of setting up user accounts with administrative privileges, without having the protection of the User Access Control that's in newer versions of Windows. (Even with User Access Control, Windows systems still do get infected, just not quite as often.)  With Unix and Linux, it's a lot harder to infect a properly configured system.

You likely already know that the all-powerful administrator account on a Unix or Linux system is the root account. If you're logged in as the root user, you can do anything you want to do to that system. So you may think, "Yeah, that's handy, so that's what I'll do." However, always logging in as the root user can present a whole load of security problems. Consider the following. Logging in as the root user can:

  • Make it easier for you to accidentally perform an action that causes damage to the system
  • Make it easier for someone else to perform an action that causes damage to the system

So if you always log on as the root user or even if you just make the root user account readily accessible, you could say that you're doing a big part of attackers' and intruders' work for them. Also, imagine if you were the head Linux administrator at a large corporation, and the only way to allow users to perform admin tasks was to give them all the root password. What would happen if one of those users were to leave the company? You wouldn't want for that person to still have the ability to log in to the systems, so you'd have to change the password and distribute the new one to all of the other users. And, what if you just want for users to have admin privileges for only certain tasks, instead of having full root privileges?

What we need is a mechanism that allows users to perform administrative tasks without incurring the risk of having them always log on as the root user and that would also allow users to have only the admin privileges they really need to perform a certain job. In Linux and Unix, we have that mechanism in the form of the sudo utility.

主站蜘蛛池模板: 井陉县| 吴桥县| 上饶市| 英吉沙县| 新乐市| 盖州市| 定兴县| 若尔盖县| 兴山县| 桂平市| 洮南市| 交城县| 池州市| 江山市| 新乐市| 和平县| 花垣县| 涿州市| 长宁区| 内江市| 高安市| 鱼台县| 济宁市| 织金县| 达拉特旗| 靖江市| 九台市| 蒙城县| 丰县| 红河县| 绩溪县| 鞍山市| 石阡县| 五寨县| 青冈县| 库伦旗| 凭祥市| 长岛县| 雷波县| 罗城| 竹北市|