Linux learning summary (three) ftp server construction

installation

sudo apt-get install vsftpd
This command will install both the client and server

Configuration

Configure on the server side and configure it for the client.
Modify the configuration file: /etc/vsftpd.conf

write_enable=YES  			 //是否拥有写权限
anon_root=/home/gt/ftp 		 //匿名用户ftp根目录
anonymous_enable=YES  		 //是否允许使用匿名用户
anon_upload_enable=YES  	 //是否允许匿名用户上传权限
anon_mkdir_write_enable=YES  //是否允许匿名用户创建目录

start up

After the configuration is complete, the new configuration must be restarted to take effect.
Restart command: sudo service vsftpd restart

Client initiates a connection

Real-name user login

Connection server: ftp + server IP
Name: server user name
Password: server login password
There is a problem:
the login password needs to be told to the login user, which is very insecure
. The user who logs in can access any directory of the ftp server, which is very insecure

Anonymous user login

Linked server: ftp + server IP
Name: anoymous means anonymous user
Password: do not fill in, just press Enter.
You can limit the location where the user logs in, and the user can only operate within the restricted range

  • Specify the anonymous user root directory:
    1. Add in the configuration file: anno_root=/home/gt/ftp
    2. Use the default location: /srv/ftp.
    Choose one of the two methods above (that is, specify the ftp root directory of the anonymous user )
  • Create a directory for anonymous users to use
    mkdir annoDir to
    modify the directory owner: sudo chown ftp annoDir to
    modify the directory permissions: chmod 777 anonDir to
    modify the directory owner and modify the directory permissions to choose one

File upload and download

  • Upload: put xxxx
  • Download: get xxxx
    pay attention to not being able to upload and download the catalog, if necessary, you can make a compressed package

drop out

  • quit
  • bye

  • Three ways to exit are OK

Introduction to lftp

lftp is a ftp client tool that can upload and download directories

installation

sudo apt-get install lftp

Login server

File upload and download

  • put upload file
  • mput upload multiple files
  • get download file
  • mget download multiple files
  • mirror downloads the entire directory and its subdirectories
  • mirror -R upload the entire directory and its subdirectories

Guess you like

Origin blog.csdn.net/bureau123/article/details/111751506