A collection of Linux operating system management skills

Source: Internet
Author: User
Tags mime file ide hard drive squid proxy
As a desktop operating system, Linux's man-machine interface is not flattering. However, as a network operating system, its ease of use (for NOS) and high performance are difficult to find its right. Of course, this does not mean that the operation is very simple, but that if you can master some skills, both system settings and network management can become easy.

As a desktop operating system, Linux's man-machine interface is not flattering. However, as a network operating system, its ease of use (for NOS) and high performance are difficult to find its right. Of course, this is not to say that its operation is very simple, but that if you can master some skills, whether it is system settings or network management, you can become easy and free.

Disable automatic power saving of display in terminal mode

After Linux is installed on most PCs, the monitor can be automatically disabled in terminal mode. However, if we want to display some information on the monitor, such as network traffic and packet analysis, this feature becomes very annoying. Changing CMOS and system attributes cannot be solved. the solution is to use setterm to set terminal commands, such as setterm -- blank, to disable the feature of automatic energy saving.

Save man help document as a common txt file

Man's position is crucial in Linux, and it is much better than the Help in Windows. However, the information it displays is not plain text. if you direct the text to a text file, you will find that the highlighted text in man is changed to two, there are countless tabs, which makes printing and editing inconvenient. However, you can use the following statement to obtain the common help text of the tcsh command: man tcshcol-B> tcsh.txt, and there will no longer be any annoying repeated characters.

IDE hard drive optimization

Linux may pay more attention to data security rather than performance, which is completely necessary for NOS, but it should be fine to enable some useful optimizations on the IDE hard disk. Take a look at this command: hdparm, which is used to display and set the parameters of the hard disk (including the optical drive. We can first use hdparm-I/dev/hda to view the parameter settings of the hda disk, and then modify it as needed, for example: hdparm-c 1 can change the I/O read/write support of the hard disk from 16 bits to 32 bits. hdparm-m 16 is the MultiCount of the hard disk. Before executing this command, you 'd better use the-I parameter to determine the maximum number of MultiCount supported by your hard disk. These two items are the main optimization items, and others cannot be determined or confused. Hdparm-t/dev/had can be used to test hard disk performance before and after optimization.

Allow root users to log on remotely

In Linux, the default security setting is that root cannot log on from a remote workstation, which makes remote management of Linux servers a lot of trouble, /etc/securtty is the key file for controlling this mechanism. in the root section of this configuration file, add pts/0 and pts/1 to the terminal name that you want the root user to log on.

Recover the Linux boot program LILO of the covered MBR (primary boot sector)

If LILO is installed in MBR, then install Linux first and then install Windows, LILO will be overwritten. in this case, we will not be able to boot Linux from the hard disk. what should we do? We can start the Windows command line model, and upload the beiloadlin.exe and vmlinuz files to the Windows partition on the linuxoptical disk, and then execute loadlin vmlinuz root =/dev/had? Rw. This command is used to start Linux from a specified partition and set root partition (1) to read/write mode. in this way, you can modify most of Linux settings or restore LILO. It should be noted that the Linux started in this case is incomplete, such as MSDOS, VFAT file system support, network, and so on, but it does not matter, as long as it can be started like this, we can use mkbootdisk to create a Linux boot disk. you can use this boot disk to start Linux. After Linux is started, you only need to set the first boot =/dev/hda? Change to boot =/dev/hda, and then execute lilo to restore Linux from MBR. Configuration file list file location and name function/etc/rc. d/rc. the public service configuration when the sysinit system is started/etc/rc. d/rc. local system startup local service configuration/etc/bashrc,/etc/profilebash shell public configuration/home/username /. bashrc user private bash shell configuration/etc/securetty terminal security settings/etc/hosts host name and IP address corresponding file/etc/resolv. confdns server configuration/etc/squid. conf or/etc/squid. confsquid proxy server software configuration/etc/smb. conf or/etc/samba/smb. conf smb-based network neighbor configuration/etc/dhcpd. list of file systems supported by the/etc/filesystems system configuration file of the dhcp server under conflinux/etc/fstab information of activated partitions in the current system/etc/host. conf specifies the configuration file/etc/lilo for the system to search dns records. configuration file of the conf startup program lilo

Most of the Linux system's control is based on configuration files. understanding these configuration files is more conducive to Linux.

The Linux startup menu is good. Unfortunately, it cannot display Chinese characters, and you cannot choose whether to start NT or Win 98. Therefore, I think it is better to use the NT series to start the menu. In fact, it is easy to do. after installing all Windows operating systems, install Linux, and install LILO to the partition where Linux is located instead of MBR. Then, use the boot disk to start Linux, mount the Windows partition to/mnt/dos. then run dd if =/dev/hda? Bs = 512 count = 1 of =/mnt/dos/bootsect. lin, so a bootsect is available in the Windows partition. lin file, which records the Linux Partition boot information, and then in the Windows NT startup configuration file boot. add C: BOOTSECT to ini. LIN = "Red Hat Linux 7.0", when we start the computer again, we find that the "Red Hat Linux 7.0" option is added in the Windows NT boot menu, and we can choose it to start our Linux. Note that NT still only recognizes files in the 8.3 format at startup, so do not change bootsect. lin to a long file name.

Use Squid to control file access

A major benefit of Linux is that it can easily route IP networks. many Linux systems are dedicated to Internet access routers. However, package filtering software such as iptables or ipchain can only control which websites the user accesses, but cannot control which files the user accesses. Using Squid, the agent server software in Linux, can easily achieve this. the urlpath_regex in the Squid. conf file controls access to each registered MIME file, for example, the following statement:

Lists the MIME file types for access control (the access control list is the acl)

       
           acl denymine urlpath_regex .exe .zip
       

Prohibit access to such files:

       
           http_access deny denymine
       

In this way, all users after this statement are prohibited from accessing the zip and exe files of the corresponding site. of course, you can add other file types, such as MP3 files. Use the ReDirect redirection function such as iptables to force users to access the Internet through the Squid proxy, that is, the so-called "transparent proxy", to completely control users' access to the site.

The system uses the default color File display. the color display of different types of files on Linux makes us feel very convenient, but sometimes this function may be accidentally lost, add alias ls = "ls -- color-F-N" to the configuration file to ensure the normal use of this function.

Cron is used to maintain the activation status of certain partitions. cron is equivalent to the scheduled task of Win 98. it can regularly execute certain commands according to user requirements. If you mount some NTFS partitions and frequently access this partition (such as Web Server access to some files), it is very likely that the data cannot be correctly read and written due to a long time, at this time, you can use cron's timed access function to ensure that the partition is always active. In my personal experience, it is recommended that the NTFS partition on the network be accessed every 15 minutes by cron. Otherwise, the mount failure may occur when the partition data is required.

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.