centos vsftp環境構築とサービスファイルリスニング


    ftp     

	       ftp

	rpm -qa|grep vsftpd

	      

	yum install -y vsftpd

	         /etc/vsftpd     

	vsftpd.conf vsftpd       

	ftpusers    

	user_list    



	   /etc/pam.d/vsftpd     pam_shells.so

	vi /etc/pam.d/vsftpd 

	#auth       required    pam_listfile.so item=user sense=deny file=/etc/vsftpd/user_list onerr=succeed
	#auth       required    pam_shells.so


	useradd fyj

	passwd fyj               

	  :                   


	  ftp

	systemctl restart vsftpd.service


	      

		cd /etc/vsftpd/

		vi vsftp.conf

		#         
		anonymous_enable=NO
		
		write_enable=YES
		pasv_enable=YES
		pasv_min_port=24500
		pasv_max_port=24600

		local_umask=022

		dirmessage_enable=YES
		
		xferlog_enable=YES
		connect_from_port_20=YES
		# Note that the default log file location is /var/log/xferlog in this case.
		xferlog_std_format=YES
		
		download_enable=YES
		
		chroot_local_user=YES
		chroot_list_enable=YES
		# (default follows)
		chroot_list_file=/etc/vsftpd/chroot_list
		
		listen=YES
		listen_address=120.26.147.187

		pam_service_name=vsftpd
		userlist_enable=YES
		userlist_deny=NO
		tcp_wrappers=NO
		allow_writeable_chroot=YES

		user_config_dir=/etc/vsftpd/userconf


		vi user_list
		fyj
		demo



      ftp        

	inotify-tool install

	yum install inotify-tools -y


	       inotify.sh



	#!/bin/bash
	#filename watchdir.sh

	#   1           API    

	inotifywait -mrqs -e delete,create --fromfile '/etc/vsftpd/inotifyFile' --timefmt '%Y-%m-%d-%H:%M:%S' --format '%T_%w_%f_%e' /etc/vsftpd/userfile/ | while read file;

	do

	curl xxxx?canshu=${file}

	done

	#   2          
	inotifywait -mrqs -e delete,create --fromfile '/etc/vsftpd/inotifyFile' --timefmt '%Y-%m-%d-%H:%M:%S' --format '%T_%w_%f_%e' /etc/vsftpd/userfile/ >> /tmp/rsync.txt


	#                1