Home  >  Article  >  Backend Development  >  Linux adds super administrator instance code

Linux adds super administrator instance code

小云云
小云云Original
2018-03-02 09:07:452000browse

How to add super administrator, view all users, and reset user files in Linux? This article will briefly introduce it to you.

useradd test #添加用户passwd test    
’ #设置密码usermod -g root test #设置用户权限su test #切换用户cat /etc/passwd  
#查看所有用户信息cp /etc/passwd- /etc/passwd  
#重置配置文件,需要root权限才能覆盖,所以丢失该文件之后要第一时间保证root的登录状态,重启就麻烦了(要么重装系统,要么在机箱上装系统盘进行恢复)
vi /etc/passwd   #设置账户配置信息
test:x:0:0::/home/test:/bin/bash

The above is the detailed content of Linux adds super administrator instance code. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn