Linux common face question 2

Source: Internet
Author: User
Tags ssh port

Blanks

1, in the Linux system, file access to the device.

2. When booting from the Linux kernel, read the file system to be loaded from the file/etc/fstab

3. Each file in the Linux file system is identified by the I node

4, all the disk block consists of four parts, respectively, the boot block, private block, I node block, data storage block

5, the foreground START process using CTRL + C prohibit

6. When installing a Linux system on a hard disk partition, there must be two types of partitions: file system and swap partition.

7, the important task of network management is to monitor and control

8, the kernel is divided into file management system, I/O management system, memory management system and process management system, such as four subsystems.


System

1, linux boot process?

1) host power-on self-test, load Bols hardware information

2) Read the MBR's boot file (Grub,lilo)

3) boot the Linux kernel

4) Run the first process init (process number is always 1)

5) Enter the appropriate operating level

6) Run terminal, enter user name and password


2, the Linux system default operating level

0. Turn off the machine

1. Stand-alone user mode

2. Multi-user mode for character interface (network not supported)

3. Multi-user mode for character interface

4. Not assigned to use

5. Multi-user mode for graphical interface

6. Restart


3, the Linux system is composed of those parts?

Linux system kernel, shell, file system and application four components


4. What is the difference between hard links and soft links?

1) Hard links may not span partitions, software chains can span partitions

2) A hard link points to an I node, while a soft link creates a new I node

3) Delete the hard link file, do not delete the original file, delete the soft link file, will delete the original file


5, how to plan a Linux host, what is the step?

1. Determine what the machine is for, such as web, DB, or game server

2, determine the good, you need to set the system how to install, the default installation of which systems, partitions how to do

3, need to optimize the system parameters, which users need to create and so on


6. View the current number of process connections for the system?

Netstat-an | grep established | Wc-l


7. How to find files larger than 10MB in the/usr directory?

Find/usr-type f-size +10240k


8, add a route to 192.168.3.0/24, the gateway is 192.168.1.254?

Route add-net 192.168.3.0/24 netmask 255.255.255.0 GW 192.168.1.254


9. How to find files that have not been accessed within 90 days in the/var directory?

Find/var \! -atime-90


10. How do I find files that have been modified 120 days ago in the/home directory?

Find/home-mtime +120


11. Look for the file "core" under the entire directory tree, if found, without prompting to delete them directly.

Find/-name core-exec rm {} \;


12, there is a general user want to backup every Sunday:00 regular/user/backup to/tmp directory, what should the user do?

Crontab-e

0 0 * * 7/bin/cp/user/backup/tmp


Safety

1, the firewall has several tables several chain?

4 sheets, 5 chains


2, a Linux system to initialize the environment after the need to do some of the security work?

1, add ordinary users, prohibit the root user login, using ordinary user login

2. Change the SSH port number

3, the server use key login, prohibit password login

4. Turn on the firewall, turn off SELinux, and set the appropriate firewall rules according to business requirements

5, install Fail2ban this to prevent SSH violent flamebreak software

6, set only allow the company office network export IP can log on the server (see the actual needs of the company)

7. Set NGINX_WAF module to prevent SQL injection

8. Start the Web service using WWW user

9. Change history command record number of bars to 10


3. What is cc attack? What is a DDoS attack? How to prevent CC attacks and DDoS attacks?

Brief introduction:

The CC attack is primarily used to attack the page, simulating multiple users accessing your page continuously, thus draining your system resources

DDoS attacks, called distributed denial of Service attacks, refers to the use of server technology to unite multiple computers as an attack platform to launch a DDoS attack on one or more targets,

An attack is a large number of legitimate requests that consume a large amount of network resources to achieve the purpose of paralyzing the network.

Prevention:

Anti-Cc/ddos attack these can only be a hardware firewall to do traffic cleaning, the attack traffic into the black hole

Flow Cleaning This piece, is mainly to buy ISP service provider's anti-attack services can be, room generally have free flow,

We generally buy services, after all, the attack will not be sustained for a long time


4, what is the site database injection? How to filter and prevent site database injection?

Brief introduction:

due to the uneven level and experience of programmers, most programmers do not judge the legality of user input data when writing code.

The application has security implications. The user can submit a database query code, according to the results returned by the program, to obtain some of the data he wants to know, this is called SQL injection.

SQL injection is accessed from the normal WWW port, and the surface seems to be no different from the general Web page access, if the administrator does not view the log habits, may be invaded for a long time will not be detected.

Filtration and Prevention:

Database Web Port Injection This, you can consider using NGINX_WAF to do filtering and prevention


Script

1. Use shell programming to determine if a file is a character device file, if it is copied to the/dev directory.

#!/bin/bash

Read-p "Input file name:" FILENAME

If [-C "$FILENAME"];then

  CP $FILENAME/dev

Fi


2, design a shell program, add a new group for Class1, and then add 30 users belonging to this group, the user name is Stdxx, where xx from 01 to 30.

#!/bin/bash

Groupadd Class1

For ((i=1;i<31;i++))

Do

If [$i-le];then

useradd-g Class1 std0$i

Else

useradd-g Class1 std$i

fi

Done


3, write shell program, realize the function of automatically delete 50 accounts. The account name is STUD1 to STUD50.

#!/bin/bash

For ((i=1;i<51;i++))

Do

Userdel-r stud$i

Done


This article is from the "Wsyht blog" blog, make sure to keep this source http://wsyht2015.blog.51cto.com/9014030/1786767

Linux common face question 2

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.