Centos7 the FTP service practice

FTP Server Configuration

Environment:
server: centos7 192.168.10.121
Client: centos7 192.168.10.122

The default server installation

  1. Installation vsftpd
    1571281764230
  2. Start Service
    1571281936192
  3. Ftp client installation service
    1571282394062
  4. The client log test
    1571282467947
  5. Vsftp modify server configuration, lock the user directory (configuration files should be backed up before modification)
    1571282826866
    1571282634334
  6. 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)
    1571282910061
    1571282794944
    1571282950049
  7. After logging test
    1571283026782
  8. Upload and download test
    1571289941469
    1571290277331
  9. 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)
    1571290675276
    1571293100358
    1571293086560
  10. Modify the configuration file, and the user is added onto list, restart the service
    1571291742997
    1571291721488
    1571291755208
    1571291703302
    1571291815560
  11. Users log in and upload and download
    1571293158367
    1571293176071
    1571293197869

Use virtual users log in

  1. Create a virtual user list (user list file, the user name is odd rows, even rows password)
    1571294805241
    1571294755059
  2. Converts the user list file is a data file can be identified
    1571294972712
  3. Add system users and, as a virtual user's actual mapping (the user's home directory permissions must be 755)
    1571295126262
  4. Modify vsftpd PAM configuration file amended as follows
    1571296596248
    1571296559794
  5. Modify vsftpd configuration file
    1571296620652
    1571295853820
    1571296040000
  6. File permissions set for the user control
    1571296276771
    1571296301166
    1571296264086
    1571297461832
  7. Restart Service
    1571296340866
  8. Login using anonymous accounts
    1571296683704
  9. 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
    1571296857701
    1571296951729
    1571296916235
    1571297573164

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.

Guess you like

Origin www.cnblogs.com/lastyear/p/11692701.html