Before managing the Linux system operations, check out the current Linux system version, kernel, and other information. The command is as follows:
[Email protected] ~]# cat/etc/redhat-release
CentOS Release 6.8 (Final) = = System Version Information
[Email protected] ~]# uname-r
2.6.32-642.el6.x86_64 The version number of the = = Kernel Kernel
[Email protected] ~]# uname-m
x86_64 = = is represented as a 64-bit system
1) Add a regular user account
You can use the following command to add a normal user account and set a password for it:
[Email protected] ~]# Useradd Oldboy
[Email protected] ~]# passwd Oldboy
Changing password for user Oldboy.
New Password:
Bad Password:it is too simplistic/systematic <== hint password too simple, but can ignore
Bad Password:is too simple
Retype new Password:
Passwd:all authentication tokens updated successfully.
Tip: In general, in the enterprise production environment should try to avoid direct to the root user operation, unless there is a system maintenance requirements beyond the ordinary user rights.
You can also set the password one step with the following command (where Oldboy is the user name and the password is: oldboy123456).
echo "oldboy123456" |passwd--stdin oldboy && history-c
To attempt to switch user roles, the command is as follows:
[[email protected] ~]# su-oldboy "= = by current root Administrator, switch to normal user Oldboy
[Email protected] ~]$ WhoAmI = = See what the current user is
Oldboy
[[email protected] ~]$ Su-root = = Switch to root user
Password:
Description
1) Super User root switch to the normal user, no need to enter the corresponding user password, which is equivalent to "emperor" to "minister" home.
2) Normal user switch to root or other ordinary users, you need to enter the user password switch.
3) The normal user's permission is relatively small, can only carry on the basic system Information view and so on operation, cannot change the system configuration and the management service.
4) The $ symbol is an ordinary user's command prompt, #符号是超级管理员的提示符. Examples are as follows:
[[Email protected] ~]$ "= = Normal user Oldboy corresponding prompt
[[Email protected] ~]# "= = Super Administrator root corresponding prompt
5) prompt @ The preceding character represents the current user (available WhoAmI query), followed by the hostname (available hostname query), ~ location is the path where the current user of the window resides. Examples are as follows:
[Email protected] ~]$ ==oldboy is the current user, backup is the hostname, ~ indicates the current directory, that is, home directory.
6) The Linux command prompt is controlled by the PS1 environment variable. Examples are as follows:
[[Email protected] ~]# set |grep PS1 <== Note PS1 is uppercase
Here ps1= ' [\[email protected]\h \w]\$ ', can be configured by global variables/etc/profile file Adjustment ps1= ' [\[email protected]\h \w]\$ '.
This article is from the "Serve the" blog, please be sure to keep this source http://junhun.blog.51cto.com/12852949/1926037
First: User Switching of Linux system Application management