Home > Article > Backend Development > Linux adds super administrator instance code
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!