Common Linux commands and server configurations-Linux Enterprise applications-Linux server application information. For details, refer to the following section. Transfer
1. Add User useradd command
Example:
# Useradd? M? G users? G wheel, sales? S/bin/tcsh? C "a user" myname
The configuration file/etc/sysconfig/network-scripts/ifcfg-eth0 can be edited with vi. Example:
DEVICE = eth0 # DEVICE name, with the same name as the file.
ONBOOT = yes # Start the device when the system starts.
BOOTPROTO = static
IPADDR = 202.118.75.91 # IP address of this Nic
NETMASK = 255.255.255.0 # Subnet Mask
GATEWAY = 202.118.75.1 # gateway ip Address
MACADDR = 00: 02: 2D: 2E: 8C: A8 # mac address
10. FTP service
10.1 run the setup command to enable the vsftpd service process.
10.2 then modify the file/etc/xinetd. d/vsftpd. (However, vsftpd is attached to xinetd. d runtime 2 and 3)
(1) Change disable = yes to = no.
(2) configure the maximum number of connections for each client:
Add the following configuration statement to the configuration file/etc/xinetd. d/vsftpd:
Per_source = value. For example, per_source = 5 indicates that the maximum number of connections for each client is 5.
(3) configure the total number of concurrent connections on the server:
Add the following configuration statement to the configuration file/etc/xinetd. d/vsftpd:
Instances = value. For example, instances = 200 indicates that the total number of connections supported by the FTP server is 200.
(4) When vsftpd is run independently: it is very easy to configure an independent vsftpd. You only need to add the following configuration on the basis of the preceding main configuration file.
Set listen = YES: indicates that vsftpd is started independently.
Set max_clients = 200: indicates the total number of concurrent connections on the server.
Set max_per_ip = 4: specify the maximum number of connections for each client.
10.3 Configure/etc/vsftpd. conf (redhat9 is the/etc/vsftpd. conf file.
# Allow access by real users (users with accounts in the System)
Local_enable = YES
# Write permissions for real users
Write_enable = YES
# Set the mask of the uploaded files to 022. In this way, the permissions of uploaded files are 755 (rwxr-xr-x), that is, the file owner can read and write, the members of the same group can read and write,
# Other users in the system are readable and executable.
Local_umask = 022
# Anonymous user access is allowed. The anonymous user's account in the system is ftp
Anonymous_enable = YES
# Set the mask for files uploaded by anonymous users. In this way, the object upload permission is 777 (rwxrwxrwx), that is, all users can read and write the object.
Anon_umask = 000
# Anonymous users can upload and create directories. The three rows are valid only when write_enable = YES is set.
Anon_upload_enable = YES
Anon_mkdir_write_enable = YES
Anon_world_readable_only = NO
# Add the following code to grant anonymous users the permission to delete objects:
# Anon_other_write_enable = YES
# A specific prompt is displayed in each directory. These prompts are stored in the. message file in various directories.
Dirmessage_enable = YES
# When a user logs on to the ftp server, the following information is displayed no matter whether the logon is successful or not.
Ftpd_banner = Welcome to NiHao FTP service.
# Use logs to upload and download logs.
Xferlog_enable = YES
# Log File Location
# Xferlog_file =/var/log/vsftpd. log
# Use the standard fpd format for logs
Xferlog_std_format = YES
# The ftp service port is 20
Connect_from_port_20 = YES
# When users access the server through ftp, their login directory is used as the directory they see in ftp, which is called chroot.
# In this way, users cannot access contents other than their login directories, greatly enhancing security. The logon directory for anonymous users is/var/ftp/
Chroot_list_enable = YES
# The user in the/etc/vsftpd. chroot_list file is not chroot.
Chroot_list_file =/etc/vsftpd. chroot_list
# A maximum of five users can log on at the same time.
Max_clients = 5 # Some do not support this option. Just comment it out.
# Ftp service password verification module.
Pam_service_name = vsftpd
# Listen = YES # add this item (redhat9) if it runs independently ).
# Tcp_wrappers = YES # add this item (redhat9) if it runs independently ).
10.4 restart the xinetd service so that you can access your ftp server anonymously.
Next we will create an ftp Administrator Account
In the Linux ftp service, user permissions are restricted. First, permission restrictions for Linux file systems. The access permission for each file is expressed in rwxrwxrwx. Each user can only perform operations permitted throughout the county. Second, restrictions on ftp configuration. The operation permitted by the system. If the ftp configuration file is not permitted, the user still cannot perform this operation. For example, if the permission of a file is rwxrwxrwx, the system deems that anyone has the right to read and write the file. If anonymous users are not allowed to write data in vsftpd. conf, anonymous users still cannot modify this question.
The read permission on the directory file means that the file information in the directory can be read. Directory file write permission, which means you can create, delete, and rename files under this directory.
Run groupadd-r ftpAdmin to add an ftp Administrator group. -R indicates that this is a system group.
Run the useradd-c "ftp Administrator"-d/var/ftp/-G ftpAdmin-s/sbin/nologin-r ftpAdmin command to add an Administrator ftpAdmin. Where
-C "ftp Administrator" is the description of this user
-D/var/ftp/is the user's login directory
-G ftpAdmin is the user's group
-S/sbin/nologin is the shell used when the user logs on. This shell command is so weak that it cannot be accessed through telnet. That is to say, this administrator can only be a garbage cleaning worker. (Haha. Postmaster)
-R indicates that this is a system account and you do not need to create a login directory for it.
After the Administrator is created, give the incoming Directory management right to him.
Chown ftpAdmin/var/ftp/incoming: Set the directory owner to ftpAdmin.
Chmod 755/var/ftp/incoming: sets the directory permission to the owner for read/write execution. users in the same group can read and execute, and all users can read and execute.
In this way, our administrator can start management.
10.5 configure vsftpd to allow anonymous users to upload
// Modify the main configuration file/etc/vsftpd. conf of vsftpd
# Vi/etc/vsftpd. conf
// Delete the # Before the following two rows
// ① # Anon_upload_enable = YES allow anonymous users to upload
// ② # Anon_mkdir_write_enable = YES Enable write and Directory Creation permissions for anonymous users
// If you want the above two settings to take effect, you must also:
// (1) write_enable = YES
// (2) Anonymous Users have the write permission on the file system's upload directory
// Add the following configuration statement
// Anon_world_readable_only = NO
// The preceding configuration statement is used to open the browsing permission of anonymous users.
// Save the disk and exit vi after modification
//
// Create an anonymous upload directory
# Mkdir/var/ftp/incoming
# Modify upload Directory Permissions
# Chmod o + w/var/ftp/incoming/
#
// Restart xinetd
# Service xinetd restart
11. Web Services (httpd)
Select the httpd service in setup. The www Service does not require xinetd as its proxy process. The httpd process has been running in the system. The default www Service Directory is/var/www/html. You only need to put the home page in this directory to access it.
We can create a www administrator wwwAdmin by setting up an ftp administrator. Set the login directory to/var/www/html.
/Etc/init. d/httpd start # start the service
/Etc/init. d/httpd restart # restart
The configuration file is/etc/httpd/conf/httpd. conf.
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