Linux App IQ

xiaoxiao2021-03-06  19

Desktop Q: How to make the system you can automatically exit after stopping operation for a while?

A: When the root account leaves the computer, it is best to allow the system to automatically exit after a period of time. In order to do this, you must set the specified time (in seconds) for a "TMOUT" Linux variable. Edit the "/ etc / profile" file, add "tmout = 300" after "HistfileSize =", add this row of this line for 5 minutes. When the content is placed in the "/ etc / profile" file, the system will automatically notify all user systems in the system will exit all user systems in the system for 5 minutes. Root users can also set this variable in their respective ".bashrc" files, so that the system can automatically exit after the specified period of time is not used. This variable parameter is set in the system, you must first exit the system, and then log in again with the root account, the setting will take effect.

Q: How do I add SIMSUN.TTC font on Red Hat 7.3? Answer: Red Hat 7.3 Select the Simplified Chinese installation, first copy a simsun.ttc to / usr / x11r6 / lib / x11 / font / trueType, renamed as SIMSun.ttf; then enter / usr / x11r6 / lib / x11 / font / TRUETYPE directory, run the TTMKFDIR> FONTS.DIR command; then edit the Fonts.Dir file with the VI, modify the SIMSUN.TTTF line as follows:

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-0-C-0-ASCII-0

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-0-C-0-ISO10646-1

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-P-0-ISO8859-15

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-0-P-0-ISO8859-1

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-0-C-0-GB2312.1980-0

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-0-P-0-GB2312.1980-0

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-Normal - 0-0-0-0-m-0-GB2312.1980-0

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-P-0-GBK-0

Then run the CAT FONTS.DIR> FONTS.SCALE command, modify / etc / x11 / xf86config-4, plus the following line:

Fontpath "/ usr / x11r6 / lib / x11 / fonts / trueType"

Finally returned to the KDE desktop, "Start" → "Options" → "View" → "Font", change all fonts to SIMSUN. Q: What is the difference between Unicon and ENCON? What is the role? A: Unicon is the Chinese platform of the kernel state, based on modifying Linux FrameBuffer and Virtual Console (FBCON). Since it is implemented under the underlying system, it is excellent in compatibility and can directly support GPM mouse. But relatively dangerous, slightly vulnerabilities may endanger system security. ENCON is a user-state Chinese platform, a bit like UCDOS.

Q: How do I uninstall the TAR format file? A: The usually used Make Install in the normal compilation process will be installed in the corresponding path. The most insurance method is to check the Makefile file, mainly to see the install section, from which the file is found in the TAR format is copied to what the path is copied, and then enter the corresponding directory to delete. Q: After SOCKS5 is started, it stopped for a while. After viewing the command PS Auxw | GREP SOCKS5, there are many Socks Defunct processes. Is this what is the reason? A: It is mainly a problem that patch. If SOCKS5-TAR.GZ is the version of the patch, the next V1.0-R11 version, reinstall, and run the problem can be solved. Q: When I installed Debian 3.0 in VMware WorkStation 4.0.5, I couldn't find the hard disk and needed the drive of SCSI. But I use the IDE hard drive, what should I do? A: Since VMware is virtualized to the SCSI hard disk space, there is no corresponding driver in the Debian installation disc, and some of the other Linux versions are installed, so there is no such problem. The user can modify the configured VMware to the analog IDE hard drive. Q: After the Red Hat is installed, can the prompt for root @ localhost can be modified? A: Of course you can. The prompt in Bash is specified by an environment variable $ PS1. Use Export $ PS1 to view the current value, compare the intuitive and common prompts can be set to Export PS1 = "[/ u @ / h / w] / $". Where / u represents the username, / h represents the host name, / W represents the last layer of the current working directory, if it is ordinary user / $, the Root user displays #.

Q: Search a word in Vi, the word is highlighted, it looks very uncomfortable, how can I remove it? A: Enter in the vi command mode: nohlsearch is OK. Also, you can write the following statement in ~ / .vimrc, you will be highlighted:

SET HLSEARCH

Plus the following statement will not highlight:

Set nohlsearch

Q: How do I find out all the * .cpp, *. H files in the system?

A: You can use the find command. However, if you look for a higher resource from the root directory, you can use the following command:

#: find / -name "* .cpp" -o -name "* .h"

Q: Is it enough to install DEBIAN? Do you have to download all 7?

A: If there is a network environment frequently, you can download the first one. If you don't have a network environment, you do not recommend using Debian because Debian mainly rely on the network to update the software. If you are installing, you want to download all 7 plates, otherwise you may have a problem that you can find.

Q: Why did the first disc of DEBIAN have two versions? DEBIAN-30R1-I386-Binary-1.iso and Debian-30R1-I386-Binary-1_nonus.iso which version of this download? What is the difference?

A: Because software containing "Non-US" (not the United States) cannot be legally stored in a server in the United States. Previously, the reason is usually because the software contains strict password encoding, and today, it is because the program uses the US patent protection algorithm. Everyone should use "Non-US" to use it for private purposes; if there is no ISO that is identified, only the mirror and supplier of the United States and suppliers. Other binary discs do not contain any "US-Sensitive" software, which works well with other Binary-1 CDs. Therefore, personal use or download Debian-30R1-i386-binary-1_nonus.iso version. Q: Why do I appear in the statement like Device Is Busy when using umount / mnt / cdrom command, can not umount?

A: When using umount, be sure to quit / mnt / cdrom, you can use Umount / MNT / CDROM to exit this directory.

Q: I use a laptop, how can I display how much power left now?

A: How many minutes can you see using APM -M, and the specific parameters can be viewed with Man APM.

Q: How do I use the Red Hat to automatically update the software package?

A: Red Hat 6.1 has a command UP2DATE, which can automatically detect which packages need to be updated, and then UP2DATE-Config can then be configured. When using UP2DATE for the first time, the root user needs to perform rpm-import / usr / share / rhn / rpm-gpg-key, and then run up2date, which will verify via SSL, if the user provides the correct registration information when the user is installed, Then you can upgrade the package automatically. Among them, the RPM except Kernel is upgraded with UP2DATE -U -F, including Kernel, including Kernel.

Q: Why do I have garbled when I entered the terminal window of Linux?

A: This is because you have a problem with your character set. Temporary solutions can use export lang = "en_us". If you don't have to modify each time, you can modify lang = "en_us" in / etc / sysconfig / i18n file. You can also do it for a user so that you can change your personal interface language without affecting other users. The command is as follows:

#CP / etc / sysconfig / i18n $ homen / .i18n

Q: When downloading the Red Hat CD from the online FTP, there is an MD5 check code on the right, how can I know that the check code is correct?

A: You can get the check code by command MD5Sum FileName, then compare it and give it to see if it is the same.

Q: I need to let the users below Linux must be greater than 4 digits when setting passwords, how to set it?

A: Modify the pass_min_len in the /etc/login.defs file (this item is used to set the number of the password) value.

Q: How to check what program is running on a port?

A: You can use the LSOF command, such as to see if you want to see what program is running, you can perform the following command:

# lsof -i: 21

Q: When compiling the kernel, I prompt "Too Many Open File", how to deal with?

A: This is because the File-Max default value (8096) is too small. To resolve this problem, you can perform the following commands as you root (or add them to the init script under /etc/rcs.d/*): # echo "65536"> / proc / sys / finally enter the decompressed directory, run the installation command.

# cd vmware-linux-tools

# ./install.pl

Q: I have been installed with Windows XP. After reloading Windows XP once, I found the launch menu of Linux and Windows XP, how to solve it?

A: First, the CD is started, enters the RESCUE mode, runs GRUB, enter the GRUB prompt grub>, then tap the following statement, it will be fine.

Root (HD0, 2), SETUP (HD0)

The internet

Q: May I ask the user's IP is dynamic, how do I define the number of online online in Squid?

A: For example, restricting a single user can only open 12 HTTP connections, using the following method:

ACL ALL SRC 0.0.0.0.0.0.0.0

ACL LIMIT MAXCONN 12

ACL LocalNet SRC 192.168.0.0/24

HTTP_ACCESS DENY LOCALNET MAXCONNNNNNN

HTTP_ACCESS Allow LocalNet

HTTP_ACCESS DENY ALL

Q: If I use the Squid agent agent server in 192.168.1.0, for example, its IP is 192.168.1.1, I have some clients to set up this proxy server in 192.168.2.0. How to set up this proxy server ?

A: If you don't have to use a transparent agent, you can set it directly in the browser's proxy option. Otherwise, first, on the network card of the proxy server, then an IP is 192.168.2.1, add the corresponding route, modify the listening address and port in the Squid Squid.conf file, and finally set at the client of the 192.168.2.0 network segment. Its gateway is 192.168.2.1, and then set it directly in the browser's proxy option.

Q: I passed a text file in Windows to Linux, but after opening a text file, each line has a logo of ^ m. Due to the long, use the editor to remove too much trouble, what is the solution?

A: In order to solve this problem, there are two tools under Linux to interchange the Windows format and Linux format, which are DOS2UNIX and UNIX2DOS, respectively. For example, use the following command to convert the file name "filename" file from the Windows format to Linux text format.

# dos2unix filename

Q: Installed a Linux server, I want to compile the kernel, step by step, Grub also added it, but "kernel PANIC: VFS: Unable to Mount Root Fs on 0:00" error, what is going on? thing?

A: Under normal circumstances, the file is not required on the desktop, but it is necessary to have a SCSI device server. It is possible that there is no initrd file due to compiled kernels, so there will be the above error prompt. Users can use the mkinitrd command to generate an init.img file, then join GRUB, and try again.

Q: How do I set up the welcome information after the user login? A: Modify the / etc / motord file, write text in the inside, enable the user to get the corresponding prompt information before being properly logged in with Telnet.

MOTD is "Messages of the Day", which is the meaning of the current day. Administrators can write some items or notifications you need to pay attention to reminding formal users.

Q: How do I use the NETRC file to automatically ftp?

A: Build a file that is 600, the suffix .Netrc in your own home directory, the content is as follows:

Machine 172.168.15.1 login admin Password admin

This time, each time the user logs in to the FTP server 172.168.15.1, the system will help users log in for username admin, password admin. Users can use this feature to implement automatic FTP. For example, the user wants to get the file admin.txt on / admin directs every day from 6:00 to 172.168.15.1, which can be done as follows.

Create a file ftp_cmd, the content is as follows:

CD Admin

Get amin.txt

BYE

Then use crontab -e to set the timing task:

0 6 * * * ftp 172.168.15.1

Q: How to get the log of Ipchains?

A: When the user setting rules must join the -l parameter will be recorded in / etc / messages. But the suggestion is still not good, otherwise the user's / etc / messages will become very large.

Safety

Q: I downloaded RCS5.7, using ./configure && make && make install time is wrong:

./conf.sh: Testing Permissions ...

..........................................

A: Some software does not compile with root users because other reasons considering security. At this time, just compile it with other users, when the software is installed, if the software is installed in the main directory of the user who is not compiled, you need to convert to the root user and then perform Make Install.

Q: I failed when I installed USBVIEW, and the specific situation is as follows:

# rpm -ivh usbview-1.0-9.src.rpm

Warning: USBVIEW-1.0-9.SRC.RPM: V3 DSAsignature: Nokey, Key IdAb42a60e

A: This line code shows that the installation failure is because there is no suitable key to check the signature on your system. To make the package pass through the check, you can solve it by importing the red hat, the specific way is to run down under the shell:

# rpm -import / usr / share / rhn / rpm-gpg-key

(Note cases)

Q: How do I prevent a key file from being modified?

A: Under Linux, some configuration files are not allowed to modify anyone (including root). To prevent erroneous deletion or modification, you can set the "Immutable" ". The command is as follows:

# chattr I / etc / fstab

If you need to modify the file, use the following command:

# chattr -i / etc / fstab

Q: How do I limit the number of processes that users can start? A: First determine the existence of the following line in the /etc/pam.d/login file:

Session Required /LIB/Security/Pam_Limits.so

Then edit /etc/security/limits.conf, which can set the number of processes, CPU usage, and memory usage, such as Hard NPROC 20, which means to limit MAN.

Q: How do I not display other users' messages?

A: Users can use Mesg n to ban others from sending information to themselves, in fact, it is to ban others from writing to their own terminals. When someone trying to send information to yourself using Write, the sender will see the prompt:

Write: User Has Messages Disabled on PTS / N

Q: How do I limit the SHELL command log size?

A: By default, Bash will save up to 500 command records in the file $ home / .bash_history. Sometimes depending on the specific system, the number of default records is different. There is a file in the main directory of each user in the system. In order to system security, it is highly recommended that the user limits the size of the file. Users can edit the / etc / profile file, modify the options as follows:

Histfilesize = 30 or histsize = 30

This reduces the records of the records to 30.

Q: I want to keep the information displayed when booting, to check the computer that the computer has a problem, what should I do?

A: You can enter the following command:

#dmesg> BootMessage

This command will redirect the information displayed when the boot is output to a file bootMessage.

Q: I want to delete command records when I log out, how to do it?

A: Edit /etc/skel/.bash_logout file, increase the following:

RM -F $ homen / .bash_history

This way, all users in the system delete their command records when logging out.

If you only need to set a specific user, such as the root user, you can modify the / full-end /.bash_history file in the user's home directory, add the same line.

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-0-C-0-ASCII-0

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-0-C-0-ISO10646-1

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-P-0-ISO8859-15

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-0-P-0-ISO8859-1

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-0-C-0-GB2312.1980-0

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-0-P-0-GB2312.1980-0

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-Normal - 0-0-0-0-m-0-GB2312.1980-0

SIMSUN.TTTF -MISC-SIMSUN-Medium-R-NORMAL - 0-0-0-P-0-GBK-0

Then run the CAT FONTS.DIR> FONTS.SCALE command, modify / etc / x11 / xf86config-4, plus the following line:

FontPath "/ usr / x11r6 / lib / x11 / fonts / trueType" finally returned to the KDE desktop, "Start" → "Options" → "View" → "Font", change all fonts to SIMSUN. Q: What is the difference between Unicon and ENCON? What is the role? A: Unicon is the Chinese platform of the kernel state, based on modifying Linux FrameBuffer and Virtual Console (FBCON). Since it is implemented under the underlying system, it is excellent in compatibility and can directly support GPM mouse. But relatively dangerous, slightly vulnerabilities may endanger system security. ENCON is a user-state Chinese platform, a bit like UCDOS.

Q: How do I uninstall the TAR format file? A: The usually used Make Install in the normal compilation process will be installed in the corresponding path. The most insurance method is to check the Makefile file, mainly to see the install section, from which the file is found in the TAR format is copied to what the path is copied, and then enter the corresponding directory to delete. Q: After SOCKS5 is started, it stopped for a while. After viewing the command PS Auxw | GREP SOCKS5, there are many Socks Defunct processes. Is this what is the reason? A: It is mainly a problem that patch. If SOCKS5-TAR.GZ is the version of the patch, the next V1.0-R11 version, reinstall, and run the problem can be solved.

Q: When I installed Debian 3.0 in VMware WorkStation 4.0.5, I couldn't find the hard disk and needed the drive of SCSI. But I use the IDE hard drive, what should I do? A: Since VMware is virtualized to the SCSI hard disk space, there is no corresponding driver in the Debian installation disc, and some of the other Linux versions are installed, so there is no such problem. The user can modify the configured VMware to the analog IDE hard drive. Q: After the Red Hat is installed, can the prompt for root @ localhost can be modified? A: Of course you can. The prompt in Bash is specified by an environment variable $ PS1. Use Export $ PS1 to view the current value, compare the intuitive and common prompts can be set to Export PS1 = "[/ u @ / h / w] / $". Where / u represents the username, / h represents the host name, / W represents the last layer of the current working directory, if it is ordinary user / $, the Root user displays #.

Q: Search a word in Vi, the word is highlighted, it looks very uncomfortable, how can I remove it? A: Enter in the vi command mode: nohlsearch is OK. Also, you can write the following statement in ~ / .vimrc, you will be highlighted:

SET HLSEARCH

Plus the following statement will not highlight:

Set nohlsearch

Q: How do I find out all the * .cpp, *. H files in the system?

A: You can use the find command. However, if you look for a higher resource from the root directory, you can use the following command:

#: find / -name "* .cpp" -o -name "* .h"

Q: Is it enough to install DEBIAN? Do you have to download all 7?

A: If there is a network environment frequently, you can download the first one. If you don't have a network environment, you do not recommend using Debian because Debian mainly rely on the network to update the software. If you are installing, you want to download all 7 plates, otherwise you may have a problem that you can find. Q: Why did the first disc of DEBIAN have two versions? DEBIAN-30R1-I386-Binary-1.iso and Debian-30R1-I386-Binary-1_nonus.iso which version of this download? What is the difference?

A: Because software containing "Non-US" (not the United States) cannot be legally stored in a server in the United States. Previously, the reason is usually because the software contains strict password encoding, and today, it is because the program uses the US patent protection algorithm. Everyone should use "Non-US" to use it for private purposes; if there is no ISO that is identified, only the mirror and supplier of the United States and suppliers. Other binary discs do not contain any "US-Sensitive" software, which works well with other Binary-1 CDs. Therefore, personal use or download Debian-30R1-i386-binary-1_nonus.iso version.

Q: Why do I appear in the statement like Device Is Busy when using umount / mnt / cdrom command, can not umount?

A: When using umount, be sure to quit / mnt / cdrom, you can use Umount / MNT / CDROM to exit this directory.

Q: I use a laptop, how can I display how much power left now?

A: How many minutes can you see using APM -M, and the specific parameters can be viewed with Man APM.

Q: How do I use the Red Hat to automatically update the software package?

A: Red Hat 6.1 has a command UP2DATE, which can automatically detect which packages need to be updated, and then UP2DATE-Config can then be configured. When using UP2DATE for the first time, the root user needs to perform rpm-import / usr / share / rhn / rpm-gpg-key, and then run up2date, which will verify via SSL, if the user provides the correct registration information when the user is installed, Then you can upgrade the package automatically. Among them, the RPM except Kernel is upgraded with UP2DATE -U -F, including Kernel, including Kernel.

Q: Why do I have garbled when I entered the terminal window of Linux?

A: This is because you have a problem with your character set. Temporary solutions can use export lang = "en_us". If you don't have to modify each time, you can modify lang = "en_us" in / etc / sysconfig / i18n file. You can also do it for a user so that you can change your personal interface language without affecting other users. The command is as follows:

#CP / etc / sysconfig / i18n $ homen / .i18n

Q: When downloading the Red Hat CD from the online FTP, there is an MD5 check code on the right, how can I know that the check code is correct?

A: You can get the check code by command MD5Sum FileName, then compare it and give it to see if it is the same.

Q: I need to let the users below Linux must be greater than 4 digits when setting passwords, how to set it?

A: Modify the pass_min_len in the /etc/login.defs file (this item is used to set the number of the password) value. Q: How to check what program is running on a port?

A: You can use the LSOF command, such as to see if you want to see what program is running, you can perform the following command:

# lsof -i: 21

Q: When compiling the kernel, I prompt "Too Many Open File", how to deal with?

A: This is because the File-Max default value (8096) is too small. To solve this problem, you can perform the following commands as root (or add them to the init script under /etc/rcs.d/*):

# echo "65536"> / proc / sys / finally enters the decompressed directory, run the installation command.

# cd vmware-linux-tools

# ./install.pl

Q: I have been installed with Windows XP. After reloading Windows XP once, I found the launch menu of Linux and Windows XP, how to solve it?

A: First, the CD is started, enters the RESCUE mode, runs GRUB, enter the GRUB prompt grub>, then tap the following statement, it will be fine.

Root (HD0, 2), SETUP (HD0)

The internet

Q: May I ask the user's IP is dynamic, how do I define the number of online online in Squid?

A: For example, restricting a single user can only open 12 HTTP connections, using the following method:

ACL ALL SRC 0.0.0.0.0.0.0.0

ACL LIMIT MAXCONN 12

ACL LocalNet SRC 192.168.0.0/24

HTTP_ACCESS DENY LOCALNET MAXCONNNNNNN

HTTP_ACCESS Allow LocalNet

HTTP_ACCESS DENY ALL

Q: If I use the Squid agent agent server in 192.168.1.0, for example, its IP is 192.168.1.1, I have some clients to set up this proxy server in 192.168.2.0. How to set up this proxy server ?

A: If you don't have to use a transparent agent, you can set it directly in the browser's proxy option. Otherwise, first, on the network card of the proxy server, then an IP is 192.168.2.1, add the corresponding route, modify the listening address and port in the Squid Squid.conf file, and finally set at the client of the 192.168.2.0 network segment. Its gateway is 192.168.2.1, and then set it directly in the browser's proxy option.

Q: I passed a text file in Windows to Linux, but after opening a text file, each line has a logo of ^ m. Due to the long, use the editor to remove too much trouble, what is the solution?

A: In order to solve this problem, there are two tools under Linux to interchange the Windows format and Linux format, which are DOS2UNIX and UNIX2DOS, respectively. For example, use the following command to convert the file name "filename" file from the Windows format to Linux text format.

# dos2unix filename

Q: Installed a Linux server, I want to compile the kernel, step by step, Grub also added it, but "kernel PANIC: VFS: Unable to Mount Root Fs on 0:00" error, what is going on? thing? A: Under normal circumstances, the file is not required on the desktop, but it is necessary to have a SCSI device server. It is possible that there is no initrd file due to compiled kernels, so there will be the above error prompt. Users can use the mkinitrd command to generate an init.img file, then join GRUB, and try again.

Q: How do I set up the welcome information after the user login?

A: Modify the / etc / motord file, write text in the inside, enable the user to get the corresponding prompt information before being properly logged in with Telnet.

MOTD is "Messages of the Day", which is the meaning of the current day. Administrators can write some items or notifications you need to pay attention to reminding formal users.

Q: How do I use the NETRC file to automatically ftp?

A: Build a file that is 600, the suffix .Netrc in your own home directory, the content is as follows:

Machine 172.168.15.1 login admin Password admin

This time, each time the user logs in to the FTP server 172.168.15.1, the system will help users log in for username admin, password admin. Users can use this feature to implement automatic FTP. For example, the user wants to get the file admin.txt on / admin directs every day from 6:00 to 172.168.15.1, which can be done as follows.

Create a file ftp_cmd, the content is as follows:

CD Admin

Get amin.txt

BYE

Then use crontab -e to set the timing task:

0 6 * * * ftp 172.168.15.1

Q: How to get the log of Ipchains?

A: When the user setting rules must join the -l parameter will be recorded in / etc / messages. But the suggestion is still not good, otherwise the user's / etc / messages will become very large.

Safety

Q: I downloaded RCS5.7, using ./configure && make && make install time is wrong:

./conf.sh: Testing Permissions ...

..........................................

A: Some software does not compile with root users because other reasons considering security. At this time, just compile it with other users, when the software is installed, if the software is installed in the main directory of the user who is not compiled, you need to convert to the root user and then perform Make Install.

Q: I failed when I installed USBVIEW, and the specific situation is as follows:

# rpm -ivh usbview-1.0-9.src.rpm

Warning: USBVIEW-1.0-9.SRC.RPM: V3 DSAsignature: Nokey, Key IdAb42a60e

A: This line code shows that the installation failure is because there is no suitable key to check the signature on your system. To make the package pass through the verification, you can solve it by importing the red hat, the specific way is to run under the shell: # rpm -import / usr / share / rhn / rpm-gpg-key

(Note cases)

Q: How do I prevent a key file from being modified?

A: Under Linux, some configuration files are not allowed to modify anyone (including root). To prevent erroneous deletion or modification, you can set the "Immutable" ". The command is as follows:

# chattr I / etc / fstab

If you need to modify the file, use the following command:

# chattr -i / etc / fstab

Q: How do I limit the number of processes that users can start?

A: First determine the existence of the following line in the /etc/pam.d/login file:

Session Required /LIB/Security/Pam_Limits.so

Then edit /etc/security/limits.conf, which can set the number of processes, CPU usage, and memory usage, such as Hard NPROC 20, which means to limit MAN.

Q: How do I not display other users' messages?

A: Users can use Mesg n to ban others from sending information to themselves, in fact, it is to ban others from writing to their own terminals. When someone trying to send information to yourself using Write, the sender will see the prompt:

Write: User Has Messages Disabled on PTS / N

Q: How do I limit the SHELL command log size?

A: By default, Bash will save up to 500 command records in the file $ home / .bash_history. Sometimes depending on the specific system, the number of default records is different. There is a file in the main directory of each user in the system. In order to system security, it is highly recommended that the user limits the size of the file. Users can edit the / etc / profile file, modify the options as follows:

Histfilesize = 30 or histsize = 30

This reduces the records of the records to 30.

Q: I want to keep the information displayed when booting, to check the computer that the computer has a problem, what should I do?

A: You can enter the following command:

#dmesg> BootMessage

This command will redirect the information displayed when the boot is output to a file bootMessage.

Q: I want to delete command records when I log out, how to do it?

A: Edit /etc/skel/.bash_logout file, increase the following:

RM -F $ homen / .bash_history

This way, all users in the system delete their command records when logging out.

If you only need to set a specific user, such as the root user, you can modify the / full-end /.bash_history file in the user's home directory, add the same line.

转载请注明原文地址:https://www.9cbs.com/read-41369.html

New Post(0)