Zhangminghui-linux Common Catalogue-1

Source: Internet
Author: User


"The command is not for remembering, practice!" Practice! Practice! The more you practice, the more it becomes your instinct to react.



/ETC/PASSWD store the relevant properties for each user

Add User

[email protected]/]# useradd XWJ

To set a password for a XWJ user

1, [[email protected] ~]# passwd XWJ

2, [[email protected] ~]# echo "xwj123456" |passwd--stdin XWJ

Switch to normal user

[email protected] ~]# SU-XWJ

[Email protected] ~]$ tail-1/etc/passwd

User: Password: User id: Group ID: Description: Home directory: Login Shell



Note Switch User: Su-user name

The difference between Su and Su-:

The former only switches the root identity, but the shell environment is still a normal user's shell, and the user and the shell environment to switch to root identity. After the SU switch to the root user, PWD, found that the working directory is still the normal user's working directory;

With the Su-command switch, the working directory becomes the working directory of root. You should use the Su-command.



/etc/shells viewing the system's available shells



/etc/selinux/config SELinux configuration file

Beginners should turn off selinux to interfere with the learning environment, not easy to troubleshoot problems

Ways to turn off SELINUX: replace selinux=enforcing with selinux=disabled


Replace with SED

[Email protected] ~]# sed-i "S#selinux=enforcing#selinux=disabled#g"/etc/selinux/config


Method One: see if the parameters are modified

[Email protected] ~]# Cat/etc/selinux/config

Method Two:

[[email protected] ~]# grep "selinux=disabled"/etc/selinux/config

Using grep to filter out the desired result line, the file has changed

Precautions:

1. To back up the files before modifying them

2, sed first without parameter I, to see if it is the result of their own

3, plus parameter-I, to achieve the modification of the file




Change the profile to take effect only when the system or service is started, and use the command to close SELinuximmediately

View the status of SELinux

[Email protected] ~]# Getenforce

Setting The status of SELinux

[Email protected] ~]# Setenforce 0



/etc/inittab Linux system operating level

# 0-halt (do not set Initdefault to this) shutdown

# 1-single User mode single users (password loss can be used)

# 2-multiuser, without NFS (the same as 3, if you don't have networking) multiuser, no Network file system

# 3-full Multiuser mode complete multi-user model

# 4-unused reserved runlevel

# 5-x11 Desktop

# 6-reboot (do not set Initdefault to this) reboot


1, 3, 5 commonly used

Set the run level of a file



Shutdown

Shutdown-h now

Halt

Init 0


Restart

Reboot

Shutdown-r

Init 6

"Linux commands to be remembered in use"



Zhangminghui-linux Common Catalogue-1

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.