Linux system management

Source: Internet
Author: User
& Amp; 65279; & amp; 65279; (1) Linux is a multi-user system. each system user must use the user name and password. The system creates a subdirectory with the same name as the user name (the root user's main directory is root) in the home directory for each login user as the starting point for user login.

(1) Linux is a multi-user system, and each system user needs a user name and password. The system creates a sub-directory with the same name as the user name under the/home directory for each login user (the root user's main directory is/root) as the starting point for user login, you can create files and subdirectories in your home directory. Every user uses files and resources on the machine. Therefore, it is very important to manage these users to ensure system efficiency and security. Linux uses corresponding commands to manage users and user groups. Using these commands, you can control the addition, deletion, permission control, and log query of users.


(2) in Linux, the software has multiple installation package formats, and each format has its own installation commands and methods. Currently, there are two mainstream installation package formats in Linux: binary distribution package format and source code distribution package format. The binary distribution package of Linux software refers to the release form of a software package that has already been compiled as a binary version. Its advantage is that it is easy to install and use, and its disadvantage is its lack of flexibility. The binary distribution package is compiled for a specific hardware or operating system platform and cannot be correctly executed on another platform or environment. Binary distribution packages include RPM packages, dpkg packages, and packages encapsulated using tar commands.

The RPM Package is the package encapsulation format provided by Red Hat Linux. its suffix is. rpm, and dpkg is Debian fuse or. tgz. The RPM Package and dpkg package are pre-compiled installation files for applications.

For binary packages distributed using tar packages, run the command to decompress the tar package, and then run the applications in the corresponding directory or the scripts provided by the running program. Select the tar package, which depends on the user's system version and hardware platform. You can run the software normally only when you select the software version corresponding to your system version and hardware platform.

(3) the source code package is a software package visible to the source code. If a software has a source code, anyone can see how it is developed. Users can modify the source code to customize and optimize the software to meet actual needs.

(4) in Linux, a series of editors, including emacs, ed, ex, and vi, are provided to facilitate the use of various users in different environments. Among them, vi is the most common and important editor. it is the only text editor that is provided in all versions of Linux and other UNIX systems.

The vi editor has three operation modes: Command mode, Insertmode, and Last line mode)

1) system management commands
1) view user and group files. pay attention to important fields in each file.
Go to the/etc directory,
[Root @ lab root] # cd/etc/
View files related to users and user groups.
[Root @ lab etc] # ls
View user account files
[Root @ lab etc] # cat passwd
View user password files

[Root @ lab etc] # cat shadow
View user group account files
[Root @ lab etc] # cat group
View user group password files
[Root @ lab etc] # cat gshadow


2) <2> Maintenance Commands for users and group accounts
Add student user group
[Root @ lab etc] # groupadd student
Add student user and specify the user group as student
[Root @ lab etc] # useradd-g student
Set password for student user
[Root @ lab etc] # passwd student
Use the su command to convert the current user from root to student
[Root @ lab etc] # su student
Use the id command to display the UID and GID of the current user
[Student @ lab etc] $ id
Display the login user name
[Student @ lab etc] $ whoami
Switch the current user to root
[Student @ lab etc] $ su
Run the id command to view the UID and GID of student.
[Root @ lab root] # id student
Use the usermod command to change the student user name to stu.
[Root @ lab root] # usermod-l stu student
Use the groupmod command to change the student user group to stu.
[Root @ lab root] # groupmod-n stu student
Check the UID and GID of The stu user and compare them with student.
[Root @ lab root] # id stu
Delete an stu user
[Root @ lab root] # userdel stu

Check whether the stu user exists
[Root @ lab root] # id stu


(2) Software Installation
1) installation of rpm Package software
Go to the/root/lab directory, which stores the lab software.
[Root @ lab root] # cd/root/labsoft
List files in a directory
[Root @ lab labsoft] # ls
Use rpm commands to install vsftpd software (FTP software)
[Root @ lab labsoft] # rpm-ivh vsftpd-1.1.3-8.i386.rpm
Enter the/etc directory
[Root @ lab labsoft] # cd/etc/
List files. check whether the vsftpd directory exists.
[Root @ lab etc] # ls
Go to the vsftpd Directory
[Root @ lab etc] # cd vsftpd
List the files. if you see the vsftpd. conf file, the installation is successful.
[Root @ lab vsftpd] # ls
Return to the/root directory
[Root @ lab vsftpd] # cd/root
Uninstall vsftpd
[Root @ lab root] # rpm-e vsftpd
Check whether the vsftpd directory exists in the/etc directory.
[Root @ lab root] # ls/etc


2) installation of binary package software
Enter the/root/labsoft directory, which stores the lab software.
[Root @ lab root] # cd/root/labsoft
Copy the compressed package jakarta-tomcat-5.0.30.tar.gz to the/usr/local/directory.
[Root @ lab labsoft] # cp jakarta-tomcat-5.0.30.tar.gz/usr/local/
Go to the/usr/local/Directory

[Root @ lab labsoft] # cd/usr/local/
Zookeeper has jakarta-tomcat-5.0.30.tar.gz
[Root @ lab local] # ls
Use the tarcommand to decompress jakarta-tomcat-5.0.30.tar.gz.
[Root @ lab local] # tar zxvf jakarta-tomcat-5.0.30.tar.gz
Check the directory to see if the directory jakarta-tomcat-5.0.30 is generated
[Root @ lab local] # ls
Go to jakarta-tomcat-5.0.30 Directory
[Root @ lab local] # jakarta-tomcat-5.0.30 cd
List files. if you know this is a binary package, the installation is complete.
[Root @ lab: jakarta-tomcat-5.0.30] # ls-l
Back to the/usr/local directory
[Root @ lab jakarta-tomcat-5.0.30] # cd ..
Delete directories and installation files
[Root @ lab local] # rm-fr jakarta-tomcat-5.0.30
[Root @ lab local] # rm-fr jakarta-tomcat-5.0.30.tar.gz


3) installation of source code package software
Enter the/root/labsoft directory, which stores the lab software.
[Root @ lab root] # cd/root/labsoft
Copy httpd-2.0.52.tar.gz to the/usr/local/directory.
[Root @ lab labsoft] # cp httpd-2.0.52.tar.gz/usr/local/
Go to the/usr/local/Directory
[Root @ lab labsoft] # cd/usr/local/
Output the file, including httpd-2.0.52.tar.gz
[Root @ lab local] # ls
Use the tarcommand to decompress httpd-2.0.52.tar.gz
[Root @ lab local] # tar zxvf httpd-2.0.52.tar.gz
List files to see if a httpd-2.0.52 directory exists
[Root @ lab local] # ls
Go to httpd-2.0.52 Directory

[Root @ lab local] # httpd-2.0.52 cd
List files and find the source code package
[Root @ lab local] # ls
Configure source code
[Root @ lab httpd-2.0.52] #./configure
Compile source code
[Root @ lab local] # make
Install software
[Root @ lab local] # make install
Clear useless files generated during installation
[Root @ lab local] # make clean
Go to the upper-level directory/usr/local
[Root @ lab httpd-2.0.52] # cd ..
List files and check whether the apache2 directory exists.
[Root @ lab local] # ls
Go to the apache2 Directory
[Root @ lab local] # cd apache2/
List files. check that the installation is complete.
[Root @ lab apache2] # ls
Back to the/usr/local directory
[Root @ lab apache2] # cd ..
Delete directories and installation files
[Root @ lab local] # rm-fr apache2
[Root @ lab local] # rm-fr httpd-2.0.52
[Root @ lab local] # rm-fr httpd-2.0.52.tar.gz

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.