1.打开/etc/passwd文件

2.找到root:x:0:0:root:/root:/bin/bash

3.将上述文本进行修改,修改为以下内容
root:x:0:0:root:/root:/sbin/nologin