Linux System Management tips _unix Linux

Source: Internet
Author: User
Tags mime file iptables squid proxy

As a desktop operating system, Linux Man-machine interface is really not flattering, but as a network operating system, its ease of use (for the NOS) and high performance I am afraid it is difficult to have the 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 can become easy, arbitrary. Prohibit the display of automatic energy-saving in terminal mode Most PCs installed Linux, in the terminal mode can also achieve automatic turn off the display function, but if we want to display some real-time information on the monitor, such as: network traffic, packet analysis, this function becomes very annoying. The use of modified CMOS and system properties can not be resolved, the solution is to use Setterm, set the terminal command, such as Setterm--blank, you can turn off the characteristics of automatic energy saving. Saving a man's help document as a normal TXT file man's status is critical in Linux, much better than the invisible Help in Windows. But the information it displays is not plain text, and if you redirect the text directly to a text file, you'll find that the text highlighted in man becomes two, and there are countless tabs, which makes our printing and editing all the more inconvenient. But using one of these statements will give you the general help text for the TCSH command: Man tcsh|col-b >tcsh.txt, no more annoying repetitive characters. IDE hard disk optimization Linux may be more focused on data security than performance, which is absolutely necessary for NOS, but some useful optimizations to turn on IDE drives should be harmless. Take a look at this command: Hdparm, which is the function of displaying and setting the parameters of the hard disk (including the optical drive). We can first use hdparm-i/dev/hda to view the hda of this hard drive parameter settings, and then modify, such as: Hdparm-c 1 can be hard disk I/O read and write support from 16 to 32, Hdparm-m 16 is to open the hard disk multicount. Before executing this command, it is best to use the-I parameter to determine the maximum number of multicount your hard disk can support. The main optimization is these two, the other is not sure also don't mess. Hdparm-t/dev/had can be used to test hard drive performance before and after optimization. The default security setting to allow root from Telnet to Linux is that root cannot log on from the remote workstation, which causes us to manage the remote management of the Linux server, which is a key document to control this mechanism,/etc/securtty. Add pts/0, PTS/1, and so on in the root section of this configuration file to the terminal name you want the root to log on to. Recovery is overwrittenMBR (primary boot sector) of the Linux bootstrapper Lilo if Lilo is installed in the MBR, then install Linux before installing Windows,lilo will be overwritten, then we will not be able to boot Linux from the hard drive, how to do? Can we boot to Windows command-line mode, copy Loadlin.exe and vmlinuz two files from the Linux CD to the Windows partition, and then execute Loadlin vmlinuz Root=/dev/had? rw The purpose of this command is to start Linux from the specified partition and set the root partition (1) to read-write mode, so that you can modify most of the Linux settings or restore Lilo. To be aware of this situation started Linux is not complete, such as: MSDOS, VFAT file system support, network, etc. can not be used, but it does not matter, as long as this can be started, we can use Mkbootdisk to create a Linux boot disk, with this boot disk to start Linux, You can completely use Linux. When you start Linux, you can restart Linux from MBR by simply changing the first item of the/etc/lilo.conf file Boot=/dev/hda to Boot=/dev/hda and then performing Lilo. Profile list file location and name action/etc/rc.d/rc.sysinit the public service configuration when the system starts/etc/rc.d/rc.local Local Service configuration at system startup/ETC/BASHRC,/etc/profile Bash Shell's public configuration/HOME/USERNAME/.BASHRC each user private bash shell configuration/etc/securetty terminal security settings/etc/hosts the host name and the corresponding file for the IP address/etc/resolv.conf DNS server configuration/etc/squid.conf or/etc/squid/squid.conf squid proxy software configuration/etc/smb.conf or/etc/samba/smb.conf Network Neighborhood configuration based on SMB/etc/ DHCPD.CONF Linux DHCP server profile/etc/filesystems system-supported file system list/etc/fstab information on active partitions in the current system/etc/host.conf specifies the configuration file for the system to search for DNS records/ etc/lilo.conf Boot program Lilo profile Linux systems Most of the control is based on configuration files, understanding these profiles can be more conducive to the use of LinuX. Add Linux to the win nt/2000 boot menu Linux boot menu is good, but can not display Chinese, and can not choose to start NT or win 98, so I think the boot menu or use NT series good. In fact, it's easy to do, install all Windows family operating system after installing Linux, and choose to install Lilo to Linux in the partition instead of MBR, and then use the boot disk to boot Linux, the Windows partition mount as/mnt/dos ; then execute DD if=/dev/hda? bs=512 Count=1 Of=/mnt/dos/bootsect.lin, which has a Bootsect.lin file in the Windows partition that records startup information for the Linux partition, and then in Windows NT's startup configuration file Boot.ini to add C:bootsect. LIN = "Red Hat Linux 7.0", and then start the computer, we found that in the Windows NT boot menu more "Red Hat Linux 7.0" This option, select it can start our Linux. Note that NT still only recognizes files in the 8.3 format at startup, so don't change the Bootsect.lin to a long file name. Using Squid to control file types one of the great benefits of accessing Linux is the ability to route IP networks very easily, and many Linux systems are specifically used as Internet access routers. However, packet filtering software such as iptables or Ipchain only controls which sites a user accesses, and cannot control which files the user accesses. Using Linux proxy Server Software Squid can easily do this, the Urlpath_regex item in the squid.conf file is the control of each registered MIME file access, such as the following statement: #给出需要控制访问的MIME文件类型 ( Access control list (ACL) ACL denymine urlpath_regex. exe. zip #禁止这类文件的访问 http_access Deny denymine This prevents all subsequent users of this statement from accessing the corresponding site zip and exe files , of course you can add other file types, such as MP3 and so on. The use of iptables, such as redirect redirect function, forcing users through the Squid agent online, that is, the so-called "transparent agent", you can fully control the user access to the site. Let the system use the default color file to show the different types of files under the Linux terminal color display makes us feel very convenient, but sometimes may accidentally lose this feature, in the configurationAdding alias ls= "ls--color-f-n" to the file will ensure the normal use of this function. Using cron to keep some of the active states of a partition cron is the scheduled task of Win 98, which executes certain commands on a regular basis as required by the user. If you mount some NTFS partitions and frequently access this partition (such as Web server access to some files), it is likely that the time is too long to read and write the data correctly, and you can take advantage of the Cron timing access feature to ensure that the partition is always active. Based on personal experience, NTFS partitions on the network are best to have cron visit every 15 minutes, or there may be a mount failure when the partition data is needed. Note: In this article, the Redhat Linux is whichever is not stated. (Source: Sadie Net-China computer education newspaper)

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.