Linux key directory

Fox FM 2022-02-13 06:06:13 阅读数:973

linux key directory


The content of this article comes from 《 Foundation of penetration testing · Reliability and safety audit practice guide 》, It's not original


yes root User's home directory , The administrator's files are stored , Other users of the system usually cannot access this directory , Except for root user , Basically a standard user home directory


Contains binary files or compiled files , Many programs can be found in the directory

Even a lot shell Commands are also stored here ,shell The command is only from shell The program called by the terminal


and /bin Similar directory , But it contains binaries that are not suitable for ordinary users .

This directory is usually not in the default path of ordinary users , But it is in root In the user's default path , Most logged in users cannot access /sbin Directory and any commands in it


Include profile , Most applications require some configuration at startup .

This directory has several subdirectories , Each subdirectory contains different types of configuration files


It is a text database of user and user authority information

Each user record stores several fields

Field Introduce
user name Indicates the name of the user
password The second field is the password field , But it doesn't contain the actual password , In the field x Indicates that the password has been hashed , And save to /etc/shadow In file
UID Whenever a new user account is created , It will be assigned a user ID
GID and UID The fields are similar to , Specify the group to which the user belongs , The details of the group are saved in the file /etc/group in
notes / describe / User information Text description of the user
User home directory The directory used by the user as the home directory
shell Field User shell, Usually /bin/bash Or simple bash shell


The password information of the user is stored , Many resources point to passwords that are encrypted , Most likely hash encryption

Other information in the directory also includes the user name in response to the password 、 Last password change date 、 The remaining days of password modification and related information


and /etc/passwd Save user information ,/etc/group Save group information , All data related to the group is saved here , Not a directory, but a file


Modify this file for init command ,inittab The file describes which processes will be started when the system starts and runs normally .

In the final stage of kernel initialization, it will start init Program , Its process ID yes 1

init Process starts all other processes ,inittab File is for init Program configuration file , It can be edited using any standard text editor

Field Introduce
label Unique identifier , Up to four characters
Operation level Implement the purpose of this article init Level
operation Illustrates the init Operations performed on this process
process When entering the specified run level init The process of execution

When the system boots for the first time , Can scan inittab Keywords in files , These keywords tell init How to deal with it inittab Configuration command given in

Parameters Introduce
boot After starting the process, you don't have to wait for the process to complete , Continue to the next entry , When the process terminates ,init The process will not be restarted
bootwait Start the process only once , Wait for it to terminate before proceeding to the next entry
initdefault Use the maximum value in the run level field to determine the run level of this entry , If inittab There is no initdefault entry , When it starts init Request the user's initial run level
sysinit init Start the process the first time you read the table , Wait for it to terminate before proceeding to the next entry

inittab Examples of documents

# inittab for linux
1:1:respawn:/etc/getty 9600 tty1
2:1:respawn:/etc/getty 9600 tty2
3:1:respawn:/etc/getty 9600 tty3


motd yes message of the day An acronym for , This is exactly what this file contains

Short message received after logging into the system , Can be found in this file

System administrators often use it to send information to end users , This is a great place for announcements and safety tips .

As part of the penetration test , This is also a good place to leave a message .


This directory contains device files , The device file is actually the interface of the device , All devices have a corresponding device file in this directory

Some naming conventions help you navigate this directory

There are many files in this directory , Each file represents a device , There may not be all these devices on a system

Some of the most important equipment are as follows

equipment Introduce
/dev/dsp Digital signal processor , Interface between sound card software and sound card
/dev/fd0 First floppy drive
/dev/fb0 The first frame buffer device , Frame buffer is the abstraction layer between software and graphics card hardware
/dev/hda Lord IDE Master on controller IDE Driver
/dev/hdb Slave drive on master controller
/dev/hdc auxiliary IDE Master on controller IDE Driver
/dev/hdd auxiliary IDE Slave drive on controller
/dev/pda Parallel port IDE disk


This boot directory contains files that are critical to boot , The boot loader will look in this directory , A common practice is to store the kernel image in this directory


This directory and all subdirectories and files in it , Are used for all users of the system .

On a computer with multiple users linux On computer , It will soon become the largest directory on this machine , This directory also contains documents such as man pages .

linux Built in all kinds of shell The manual of command 、 Directory etc. , These are called manuals

subdirectories Introduce
/usr/X11R6 contain X Window System
/usr/bin This directory contains the vast majority of user commands , However , Some commands are also located in /bin or /usr/local/bin in
/usr/sbin This directory stores system management workers that are not required by the root file system , Manual page /usr/share/man Often used to find linux command
/usr/share/info contain GNU Information document
/usr/share/doc Contains a large number of general documents
/usr/include contain C The header file used in language programming , establish Unix People also created C Language
/usr/lib lib yes library Abbreviation , This directory contains data files for programs and subsystems , The configuration file is included
/usr/local This directory contains locally installed software and other files ,linux The distribution may not install anything here


It contains data that will change during normal operation of the system ,var My name comes from variable, Because the content will change

subdirectories Introduce
/var/vache/man Cache of man pages formatted on demand
/var/games /usr The variable data of the game is stored here
/var/lib Some miscellaneous files changed during normal operation of the system are stored here
/var/local /usr/local Variable data in the program
/var/lock On the run at linux Procedure on , This is a directory that is important for their internal operations
This directory stores lock files , Many programs are /var/lock Create a lock file in , Indicates that a particular device or file is being used This allows other programs to see that the device is in use , So you don't try to use it anymore
/var/log It's a very important Directory , It contains the log files of various programs
/var/mail When the server is used as an e-mail server , This directory contains mail files
/var/run It contains the current information of the system , The validity of this information only lasts until the next system startup
/var/spool This directory contains print queues , Therefore, it is very important to locate printer problems


It is not stored on disk , It creates... In memory , Record the information of the currently running process .


/proc/1 The currently running process 1 Information about
/proc/cpuinfo and CPU Relevant information
/proc/dma Currently in use DMA( Direct memory access ) Channel information
/proc/interrupts Interrupt data in use
/proc/ioports Currently in use I/O Port information
/proc/kcore In this directory, you can find the image of the system's physical memory , In this way, we can accurately see the situation at any given time in Physics
/proc/meminfo Contains information about the current use of memory , Including physical memory and SWAP file
/proc/kmsg Here you can see the message output by the kernel
/proc/modules It contains a list of modules loaded by the kernel at that time
/proc/stat The system contains a lot of interesting statistics
/proc/uptime System start time
/proc/version Kernel version
copyright:author[Fox FM],Please bring the original link to reprint, thank you.