FTP Server Configuration
Environment:
server: centos7 192.168.10.121
Client: centos7 192.168.10.122
The default server installation
- Installation vsftpd
- Start Service
- Ftp client installation service
- The client log test
- Vsftp modify server configuration, lock the user directory (configuration files should be backed up before modification)
- Modify the configuration file and folder permissions to upload, so that anonymous users can upload and download (ftp directory permissions should be 755, should not be modified)
- After logging test
- Upload and download test
- Create a system user used to log the ftp (need to detect when the user specifies the shell to the / etc / shells file exists the shell, there is no need to be added manually, or can not log in)
- Modify the configuration file, and the user is added onto list, restart the service
- Users log in and upload and download
Use virtual users log in
- Create a virtual user list (user list file, the user name is odd rows, even rows password)
- Converts the user list file is a data file can be identified
- Add system users and, as a virtual user's actual mapping (the user's home directory permissions must be 755)
- Modify vsftpd PAM configuration file amended as follows
- Modify vsftpd configuration file
- File permissions set for the user control
- Restart Service
- Login using anonymous accounts
- Upload and download test
Note: user1 only read access so only download not upload, user2 has upload and download rights specified when creating virtual root directory of the actual user login user's home directory
ftp commonly used commands
- Host connection
- ftp [options] [host]
- Non-interactive logon
ftp -n HOST << EOF
user USERNAME PASSWD #登录
ACTIVE #表示进行文件上传或下载
EOF #结束退出ftp
- Basic commands
- dir: display server directories and list files
- ls: Displays a list of file servers to be easily
- cd: Go to the server specified directory
- lcd: change the current working directory on the local host defaults to the current user's home directory
- cdup: go back one level
- pwd: Displays the current location path
- download
- type: View the current transmission
- ascii: transmission mode is set to the ASCII mode
- binary: the binary mode is set as transmission mode
- get: download files to the current directory get filename
- Upload
- put: Upload specified file put filename [newname]
- send: Upload specified file send filename [newname]
- drop out
- close: FTP session ends with a return to the FTP server's command state
- quit: FTP session ends with the FTP server and exit
- bye: End FTP session with the FTP server and exit
- Other commands
- delete: delete the specified file
- help: View help information
- status: Displays the current status of FTP.
- system: the type of display remote host system.