Daily Linux skills

Source: Internet
Author: User
Every day Linux tips-general Linux technology-Linux technology and application information, the following is a detailed description. 1. binary files, which can be directly installed
Example: Acrobat_reader5.tar.gz
# Tar zxvf unzip bat_reader5.tar.gz ------ three directories are generated in unzip bat_reader5: CHSKIT, CHTKIT, linux-508
# Cd export bat_reader5
# Cd linux-508 can see A reade file, it is a description document; the other is the INSTALL file.
# Chmod 755 INSTALL
#. /INSTALL ____ -------- you will see a few full screen information. This is the description of the installation file. We can press enter several times more times. After the installation, a prompt will be displayed, if you are prompted to enter "accept" and other information. After the installation is complete, return to the upper level.
# Cd ..
# Cd CHSKIT
# Chmod 755 INSTLANG
#./INSTLANG
The follow-up work is similar.
# Cd/usr/local/Acrobat5/bin is installed here by default.


Ii. Install the rpm package
Parameter
-I. Install the new software package.
-U: upgrade a software package. if the system does not exist, install the new software package.
-F update a software package. If the software does not exist in the system, the software package is not installed.
-V displays the system prompts during installation.
-H will display the installation progress bar during RPM installation so that you can know the installation process.
-E used to delete a software package. This parameter is followed by the software name, not the software package name.
-Q: list the software packages installed by the user. This parameter is followed by a software name. The name must be correct. Otherwise, it cannot be found. This parameter is generally used with parameter ..

E. g:
# Rpm-ivh glibc. rpm


3. Compile the source code file during installation:
Such as: Mplayer-1.0pre3.tar.bz2
# Bunzip2 Mplayer-1.0pre3.tar.bz2
# Tar-xvf MPlayer-1.0pre3.tar
# Cd MPlayer-1.0pre3
#./Configure
# Make
The make process is to make ". c" files into executable files. These file names that need to be compiled one by one are put in the Makefile in the current directory.
# Make install
In this process, compiled files are installed in the system.

I,
# Vi/etc/passwd
1 root: x: 0: 0: root:/bin/bash
2 bin: x: 1: 1: bin:/sbin/nologin
The/etc/passwd file is a user's management file used to manage users. The ":" In this file is the Separator in this management file. It is used to separate various related information of each user.
For example, 1 line.
Root (User Name): x (indicates that the user name has a password. If there is no "x" in this line, the user does not need to enter a password during logon ): 0 (representing the user ID): 0 (representing the user group ID): root (representing the user group name):/root (representing the user's main directory ): /bin/bash (representing the command interpreter used by the user ).
Note: in linux, user IDs are not allowed to be repeated. If the user IDs are the same, the system will grant the same permissions to the user. for example, you want to create another super user abc in the system. You can modify the/etc/passwd content as follows:
Root: x: 0: 0: root:/bin/bash
Abc: x: 0: 0: root:/bin/bash
Therefore, linux recognizes User Permissions instead of user names, but user IDs.

II,

# Vi/etc/shadow
This file stores information about the user password.
1 root: $1 $ ylyhq7gfidfiei: 12653: 0: 999999: 7 :::
Root: $1 $ ylyhq7gfidfiei, otherwise, it will fail): 12653 (from January 1, January 1, 1970 to the previous password change, how many days has elapsed): 0 (minimum interval for changing the password, "0" indicates any time can be changed. If it is "1", it indicates that the first change and the second change must be at least one day in the middle): 99999 (the maximum interval between the change of the password, that is, if it is "7", it indicates that your password is valid for only seven days. If your password is invalid for more than seven days, it will force you to change it.): 7 (how many days before the password expires, give a warning, this indicates the first seven days of password expiration, and a warning will be given) (if there is a number here, it indicates the number of days after the password expires, block the account, such as "1", it indicates 1 day) (if there is a number, it indicates the exact time and time when the account is blocked. This field is usually not used .)

Note:
The/etc/shadow file contains such information. For example, bin * 12653: 0: 99999: 7:, this "*" indicates that the user's password is the default password of the system ,, however, the current system does not have the default password, so it does not matter if you do not understand it.

III,
# Vi/etc/login. defs
This file defines some default information about the system when a user is created. First, we can see the information that has not been commented out.
For example, this file contains the following information:
# QMAIL_DIR Maildir
1. MAIL_DIR/var/spool/mail ----- email directory, which points to the/var/spool/mail directory. What is the use of this directory? If your password expires, the system will send an email to this directory where there is a file with the same name as your username.
2. PASS_MAX_DAYS 99999 indicates the maximum number of days for two password changes
3. PASS_MIN_DAYS 0 indicates the minimum number of days for two password changes
..................
In fact, the scope of the definition of this file is the rules that are given when we have commands to create users. For example, we use "useradd abc ". The value of "abc" is 99999, and the minimum value is "0. /
4. UID_MIX 500 indicates that when a user is created, the user ID is automatically granted to the user starting from the bottom line of 500.
5. UID_MAX 60000.
6. CREATE_HOME yes indicates that you must manually create a home directory for the user when creating a user. Changed to "NO". I don't know how to do it. I haven't tried it.


4. Modify user-related commands
# Useradd
Parameter:
-U: Add a user ID. If this parameter is not specified, the system starts from 500 by default.
-G: Add a user group ID.
-G: add another group because a user can belong to two groups at the same time.
-D specifies the user's home directory.
-S specifies the shell used by the user
-P: Set the password. However, the password is displayed in plain text and may not be safe to use.

E. g:
# Useradd-u 501-g bin-G root-d/home/uuser-s/bin/bash-p uuser
Note: in fact, the creation may fail and users cannot log on. The best method is:
# Useradd username
# Passwd username
# Vi/etc/passwd and/etc/shadow. modify these two files as needed.

Syslog. conf log configuration file for linux
# Vi/etc/syslog. conf
The location where different types of logs are stored is clearly defined, generally in the/var/log directory.
As a system administrator, you must have the habit of viewing logs at any time.
If you log on to another machine and do something, you need to erase some records and cannot delete the log files. Instead, you can use VI to open the corresponding logs, clear the corresponding content. Otherwise, it will be easily noticed by the Administrator.
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.