Linux Rookie starter 2 system Recovery and SELinux

Source: Internet
Author: User

Primary management of SELinux  

1. What is a SELinux

Selinux : kernel-level enhanced firewall

2. How to manage SELinux levels

SELinux turned on or off  

Vim/etc/sysconfig/selinux

selinux=disabled off state

selinux=enforcing Mandatory State

selinux=permissive Warning status

Getenforce View status

when SELinux is turned on

Setenforce 0|1 changing the SELinux run level

3. How to change the file security context

Temporary changes

chcon-t Security Context File

Chcon-t Public_content_t/publicftp-r

Permanent changes

semanage fcontext-l # #列出内核安全上下文列表内容

Semanage fcontext-a-T public_content_t '/publicftp (/.*)? '

restorecon-fvvr/publicftp/

4. How to control the SELinux switch to the service function

getsebool-a | grep service Name

getsebool-a | grep FTP

setsebool-p function bool value On|off

setsebool-p Ftpd_anon_write on

5. Monitor the SELinux error message

Setroubleshoot-server

System Recovery

1. System Startup process

Power

BIOS (in read-only storage on the motherboard, basic input or output system)

function, hardware detection, activation hardware

Grub System boot (grub boot divided into two stages)

1) Stage 1 MBR (Master boot record) master boot record 0 tracks on hard disk, one sector, 446 bytes

*) dd If=/dev/zero Of=/dev/vda bs=446 count=1 can empty MBR

*) go to save mode, perform chroot/mnt/sysimage switch to real/environment,

and execute GRUB2-INSTALL/DEV/VDA

2) Phase 2 Grub File boot phase

Locate the/boot partition

Read /boot/grub2/grub.cfg

file lost,grub2-mkconfig >/boot/grub2/grub.cfg


boot kernel, read-only mount /device

Testing equipment

Initialize the device driver

Enter the system initialization phase

Kernel is missing, the new kernel installation package can be resolved

RPM-IVH kernel-xxxxx.rpm--force

System initialization phase

system initialization phase load INITRD mirror

Open Initialization Process SYSTEMD

Start SELinux

Load Kernel parameters

Initialize the system clock, keyboard, host name

re-read/write mount /device

activating RAID,LVM

Activate quotas

start All services in the multi-user.target.wants

Turn on the Virtual Console

Start graphics

initramfs-' Uname-r '. IMG Lost by:

MKINITRD initramfs-' uname-r '. img ' uname-r '

Recovery

Enter rescue mode, PXE boot or CD-ROM (hang ISO image), troubleshoot, rescue mode Chroot/sysimage

Change Password

Start the system--"up and down" key interrupt read seconds-"E into the editor-" to modify the system initialization statements into read-write mode, Rd.break.

--"Change password--" Generate Automklebal file to let the system load the modified password


This article from the "12147236" blog, reproduced please contact the author!

Linux Rookie starter 2 system Recovery and SELinux

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.