---
title: "让root账户更安全一些"
author: "icyheart"
date: "2008-12-11T13:23:00Z"
tags: []
slug: "root"
draft: false
lastmod: "2009-07-30T16:45:11Z"
id: 436341
url: "https://sucre.iteye.com/blog/436341"
---

```
#/etc/sudoers
#
#ThisfileMUSTbeeditedwiththe'visudo'commandasroot. 
#
#Seethemanpagefordetailsonhowtowriteasudoersfile. 
#

Defaultsenv_reset

#Hostaliasspecification

#Useraliasspecification

#Cmndaliasspecification

#Userprivilegespecification

rootALL=(ALL)ALL
userALL=(ALL)ALL
```

 

 

大家以root身份登陆成功后，运行visudo后即可看到上面的内容，在默认的情况下普通用户是可以更改root的密码，这样就给root的安全性带来了很大的隐患，下面为了增加root的安全性我们可以把最后两行代码删除就是下面这两行

```
rootALL=(ALL)ALL
userALL=(ALL)ALL
```

 

 

删除以后，普通用户就不能修改root的密码了。