3-5 RPM Package Check

Source: Internet
Author: User

1.RPM Package Check

<1>rpm-v Installed package Name

<2> options:

-V checksum to develop the files in the RPM package (verify)

<3> Description:

<1> If no content is displayed, it proves that the package is OK and has not been modified

<2> once shown, the proof package has been modified,

and displays the letters (. That the property has not been modified) in the corresponding location for the modified property.

--------------------------------------------------------------------------------------------------------------- --

Verify that the content of the 8 information is as follows:

S file size is changed

M file type or file permissions (RWX) have changed

5 file MD5 Checksum is changed (can be seen as file content changes)

D the master/slave Code of the device is changed

L file path is changed

Whether the owner of the U file has changed

Whether the genus Group of G files has changed

T File modification Time changed

--------------------------------------------------------------------------------------------------------------- --

File type: the

C Profile (config file)

D Normal document (documentation)

G "Ghost file", rarely seen, is that the file should not be included in this RPM package

L Authorization Document (license file)

R profile (Read Me)

--------------------------------------------------------------------------------------------------------------- --

<3> If there is a ghost file, it is possible that there is a vulnerability or an attack

<4> This command verifies that your files are the same as the official files to determine if the system file has been modified

2.RPM in-Package file extraction

<1>rpm2cpio Package Full Name | Cpio-idv. File absolute Path

<2>---rpm2cpio//convert RPM package to cpio Format command

---cpio//is a standard tool for creating software archive documents and extracting files from archive files

<3> If you accidentally delete some important system commands, such as LS, due to misoperation,

Can be recovered by the RPM packet extraction file method

<4> commands: Cpio options < [file | device]//You can use redirects or you can use pipe breaks

Options:

-I copy-in mode, restore

-D automatically create a new directory when restoring

-V shows the restore process

-----------------------------------------------------------------------------------------------------

<1> For example, accidentally removed the LS command

where is LS

MV/BIN/LS/TMP//Because it is done experiment, do not really delete, cut just fine

<2> The LS command is not available at this time

<3> can then use Cpio to extract files from the RPM package for recovery

<4> first query which package the LS command belongs to

Rpm-qf/bin/ls

<5> then the illusion of accidentally deleting LS command

mv/bin/ls/tmp/

<6> extract the ls command from the RPM package to the current directory

rpm2cpio/mnt/cdrom/packages/coreutils-8.4-19.el6.i686.rpm | Cpio-idv./bin/ls

Indicates that the current directory is being extracted, so consider the current location

./bin/ls says I want to extract this file.

<7> copy ls command back to/bin/directory to repair file loss

3-5 RPM Package Check

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.