Collection of linux Problems

Source: Internet
Author: User
Linux problem collection-general Linux technology-Linux technology and application information. The following is a detailed description. A. umask
1. Role
Umask sets the default blocking value for creating files in User Files And Directories. If you place this command in the profile file, you can control the access permission for subsequent files created by the user. It tells the system not to grant access permission to anyone when creating a file. The permission is granted to all users.
2. umask [-p] [-S] [mode]
3. Parameters
-S: determines the current umask settings.
-P: Modify umask settings.
[Mode]: Modify the value.
4. Description
The umask value of traditional Unix is 022, which prevents other users in the same group and users in other groups from modifying the user's files. Since each user has a private group, this "group protection mode" is not needed. Strict permission settings constitute the foundation of Linux security, and making mistakes in permissions is fatal. Note that the umask command is used to set the read and write permissions of the files created by the process. The safest value is 0077, that is, to disable the read and write permissions of all processes other than the process where the files are created, -rw -------. In ~ /. In bash_profile, the umask 0077 command can be added to ensure that the umask permission of the process can be correctly set after each Shell startup.
5. Application Instance
Umask-S
U = rwx, g = rx, o = rx
Umask-p 177
Umask-S
U = rw, g =, o =

The preceding five-line command first shows the current status, and then changes the umask value to 177. Only the file owner has the permission to read and write the file, and other users cannot access the file. This is obviously a very safe setting.
B. Problems in Ubuntu:
1. No root password is installed by default. To enter the system, shell> sudo passwd root will prompt you to enter the root password.
2. Use utf8 instead of cp936 to mount windows files in Ubuntu. Otherwise, garbled characters are displayed in Chinese. That is, add the following content to the etc/fstab file:
/Dev/hda5/mnt/d vfat auto, utf8, umask = 000 0 0
3. You cannot use rpm to install software in Ubuntu. It uses the dpkg command and its installation package is the. deb file. You can use the alien command to convert the rpm package to the deb file: alien-d *****. rpm. The differences between dpkg and rpm commands are listed later.
4. Install SCIM Input Method
Sudo apt-get install scim-modules-socket scim-modules-table scim-pinyin scim-tables-zh scim-input-pad
Write export XMODIFIERS = @ im = SCIM; export GTK_IM_MODULE = "scim"; scim-d to the file:/etc/X11/Xsession. d/95 xinput.
Sudo chmod + 755/etc/X11/Xsession. d/95 xinput
5 font beautification
Wget-c http: // 222.19.211.78/ftp/cartoon/font/VeraSansYuanTi.tar.gz
Tar-xzvf VeraSansYuanTi.tar.gz
Sudo mv VeraSansYuanTi/usr/share/fonts/
Sudo fc-cache-f
Sudo cp/etc/fonts. conf/etc/fonts. conf. old
Sudo cp/usr/share/fonts/VeraSansYuanTi/fonts. conf/etc/fonts/
Restart X (Press Ctrl + Alt + return key at the same time)
6. Set LC_ALL and other attributes.
Sudo gedit/etc/environment
In the editor, modify the content as follows (the Chinese interface is used by default ):
LANGUAGE = "zh_CN: zh: en_US: en"
LC_CTYPE = zh_CN.UTF-8
LANG = zh_CN.UTF-8
Ststst_id3_tag_encoding = GBK
To use the English interface, modify the content as follows:
LANGUAGE = "en_US: en"
LC_CTYPE = zh_CN.UTF-8
LANG = en_GB.UTF-8
Ststst_id3_tag_encoding = GBK
Reboot X takes effect
7. Install the multimedia playback Driver (otherwise rmvb cannot be viewed)
Sudo apt-get install beep-media-player totem-xine w32codecs
8 install gcc-3.4: apt-get install build-essential gcc-3.4
Installation header file: apt-get install linux-headers-2.6.12-10-386
Create a symbolic link: ln? S/usr/bin/gcc-4.0 gcc
In this way, build points to the correct source code tree.
Sudo apt-get install kdevelop3
Sudo apt-get install gt3-designer
Sudo apt-get install libtool
Sudo apt-get install console
Sudo apt-cache search *
10. kdevelop3 &

C. dpkg vs rpm
List software packages installed in the system
Rpm-qa
Dpkg -- list
List software package information
Rpm-qi pkgname
Dpkg -- status pkgname
List the files installed in a package
Rpm-ql pkgname
Dpkg -- listfiles pkgname
List information about local package files
Rpm-qpi file. rpm
Dpkg -- info file. deb
List files contained in local package files
Rpm-qpl file. rpm
Dpkg -- contents file. deb
Install local package
Rpm-I file. rpm
Dpkg -- install file. deb
Clear package from System
Rpm-E pkgname
Dpkg -- purge pkgname
Query file ownership
Rpm-qf file
Dpkg -- search file
D. tips:
View bash version:> echo $ BASH_VERSION
Test script file:> source myscript or> chmod a + x myscript;./myscript
Simple command combinations can be implemented using semicolons, as shown above.
The first line of the script must be :#! /Bin/bash. It specifies the name of the interpreter responsible for executing the script.
In Bash, double quotation marks are slightly weaker in function than single quotation marks. Double quotation marks allow special characters to keep their meanings unique. Single quotes are mandatory to block the special meaning of any character. Single quotes prohibit variable interpolation, but double quotes do not, such:
> Echo "Path: $ PATH" correctly displays Environment Variables
> Echo 'path: $ path' will display: Path: $ PATH
Therefore, double quotation marks are used unless otherwise specified.
You can use ''in a too long script to divide it into short lines.
Rev: get any keyboard input and display them on the screen.
In linux, declare the variable with the $ symbol before the variable name to delete the variable and use the unset command to release the memory.
/Bin stores binary files such as ls and cat.
/Boot files required to start the system.
/Etc system configuration file and Initialization Script
/Dev linux system entry for a large number of devices
/Basic dynamic library required for running the program when the lib system starts
/Lost + found if an error occurs when a file system is running, the file system Repair Tool (fsck) will save the recovered data in this directory.
/Proc is a virtual directory where files and directories do not actually exist on any disk of the system. The system is created to pass system information to other applications.
/Sbin start system programs and binary files
/Usr is a directory for users who normally run the system to store fixed files and data.
E. Set the startup project:
First install a tool:
Sudo apt-get install sysv-rc-conf
Then start like this:
Code:
Sudo sysv-rc-conf
(Note: after entering, draw "X" to select and start .) In this software, you can use the keyboard's arrow keys to move and use spaces to select them. You can also use the mouse to select them, and then use q to save and exit. The service names and basic explanations are listed.
Code:
Acpi-support: the default value for power support is 1, 2, 3, 4, and 5. I think you can adjust it to s level.
The acpid acpi daemon. The default value is 2-5.
The alsa sound subsystem should not be enabled.
Alsa-utils seems to have replaced alsa, so you can enable it. I can enable it at the S level.
Anacron is a service used to execute a program that has not been executed at the time. I think it doesn't matter, so you can turn it off.
Apmd is also a kind of power management. I think it is not necessary to enable a computer if it is not very old.
Atd is similar to anacron. I shut it down.
Bluez-utiles: the legendary Bluetooth service, and I'm sorry I didn't have it, so I turned it off.
Bootlogd seems to be used to write logs. It may be better to enable it during the security period.
Cron specifies the time to run the program service, so it is better to open.
Cupsys printer service, so if you have it, enable it.
The producer message bus system is very important and must be enabled.
Dns-clean is used for dial-up connections. If not, it is disabled.
In the evms Enterprise Volume management system, I disabled it because I didn't understand what it was called an enterprise volume.
Fetchmail is used for email daemon. I disabled it.
I shut down the table manager for gmtms, and then started gnome with startx.
For halt shutdown, do not change
Hdparm, as I mentioned earlier, does not need to be enabled without an ide hard disk.
Hotkey-setup: This is the hotkey ing designed for some brands of laptops. Please turn it off for desktop users.
Hotplug is used for hot swapping. I have tested it. disabling it on some computers will invalidate the sound card. Enable it at S level.
It should be available if it is dedicated to the HPC hp printer.
It seems useless to rename the ifrename network interface.
If ifupdown is used to open the network, open it.
Ifupdown-clean is the same as above.
The klogd linux daemon accepts records from the kernel and sends messages to syslogd and records them as a file. Therefore, open it.
Linux-restricted-modules-common is used to use restricted modules. You can view the restricted modules under/lib/linux-restricted-modules. If there is nothing, you can turn it off.
Lvm logical volume manager. Disable it if you do not have one.
Makedev is used to create a device to/dev/. Do not change it.
Mdamd manages raid. If not, disable it.
Module-init-tools is added from/etc/modules to the extension module, which is usually open.
Networking adds network interfaces and configures dns.
The ntp-server is synchronized with the ubuntu time server.
Pcmcia activates the pcmica device. Unfortunately, I have never seen such a device in my life.
Powernowd is a client program used to manage cpu. If there is a variable frequency function, such as amd's quite 'Cool, enable it.
I disabled the ppp dialing service.
The same is true for ppp-dns.
The readahead pre-loading service reminds me of Windows pre-reading. Of course, they are different. It slows down startup by 3 to 4, So I disabled it.
Reboot is used for restart. Do not change it.
Rmnologin if nologin is found, remove it and do not enable it in the notebook.
Rsync protocol daemon, depending on the situation.
Screen-cleanup: a script to clear the boot screen.
Send messages to all processes when sendsigs is restarted or shut down. So don't worry about it.
Single is activated, but user mode is not required.
Stop-bootlogd stop bootlogd from Level 2, 3, and 4, regardless of it.
Sudo. You don't have to worry about it.
Sysklogd is used to record system log information.
Udev user space dev file system.
Udev-monoclonal is the same as above.
Umountfs is used to detach a file volume.
Urandom generates a random number and does not know how to use it.
The nice boot screen of usplash, But I shut it down and it also exists. To disable it, you need to delete the splash in the kernel startup parameters.
Vbesave graphics card bios Configuration tool, don't worry about it.
Xorg-common sets x service ice socket. Ignore it.

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.