本文共 2574 字,大约阅读时间需要 8 分钟。
【资料整理】vsftpd安装配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | http: //wiki .qcloud.com /wiki/ %E9%83%A8%E7%BD%B2%E4%BB%A3%E7%A0%81%E5%88%B0CentOS%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8 开发者需要使用FTP通道,将应用程序从开发者自己的服务器上传到云服务器上。 本文介绍本地环境为Windows,如何将应用程序上传到CentOS云服务器。 Step1. 在云服务器配置FTP服务 1. 在root权限下,通过如下命令安装Vsftp。 [root@VM_250_202_tlinux ~] # yum install vsftpd 2. 在启动vsftpd服务之前,需要登录云服务器修改配置文件,将匿名登录禁用掉。 打开配置文件,命令如下: [root@VM_250_202_tlinux ~] # vim /etc/vsftpd/vsftpd.conf 在配置文件中第11行的“anonymous_enable=YES”前面加上 #号,即将匿名登录禁用。 3. 读取生效配置。 [root@VM_250_202_tlinux ~] # cat /etc/vsftpd/vsftpd.conf |grep ^[^#] local_enable=YES write_enable=YES local_umask=022 anon_upload_enable=YES anon_mkdir_write_enable=YES anon_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_std_format=YES listen=YES pam_service_name=vsftpd userlist_enable=YES tcp_wrappers=YES 4. 启动vsftpd服务。 [root@VM_250_202_tlinux ~] # service vsftpd start 5. 设置FTP用户账号。设置成功后,即可通过该账号登录FTP服务器。 (1)设置FTP用户的账号,例如账号为“ftpuser1”,目录为 /home/ftpuser1 ,且设置不允许通过 ssh 登录。 [root@VM_250_202_tlinux ~] # useradd -d /home/ftpuser1 -s /sbin/nologin ftpuser1 (2)设置账号对应的密码,例如密码为“ftpuser1”。 [root@VM_250_202_tlinux ~] # passwd ftpuser1 6. 修改vsftpd的pam配置,使开发者可以通过自己设置的FTP用户帐号和密码连接到云服务器。 (1)修改pam。 [root@VM_250_202_tlinux ~] # vim /etc/pam.d/vsftpd 内容修改为: #%PAM-1.0 auth required /lib64/security/pam_listfile .so item=user sense=deny file = /etc/ftpusers onerr=succeed auth required /lib64/security/pam_unix .so shadow nullok auth required /lib64/security/pam_shells .so account required /lib64/security/pam_unix .so session required /lib64/security/pam_unix .so (2)确认修改后的文件是否正确。 [root@VM_250_202_tlinux ~] # cat /etc/pam.d/vsftpd #%PAM-1.0 auth required /lib64/security/pam_listfile .so item=user sense=deny file = /etc/ftpusers onerr=succeed auth required /lib64/security/pam_unix .so shadow nullok auth required /lib64/security/pam_shells .so account required /lib64/security/pam_unix .so session required /lib64/security/pam_unix .so (3)重启vsftpd服务,使修改生效。 [root@VM_250_202_tlinux ~] # service vsftpd restart Shutting down vsftpd: [ OK ] Starting vsftpd for vsftpd: [ OK ] Step2. 下载并安装开源软件FileZilla 请使用FileZilla的3.5.1、3.5.2版本(使用3.5.3版本的FileZilla进行FTP上传会有问题)。 由于FileZilla 官网上只提供了最新的3.5.3版本下载,因此建议开发者自行搜索3.5.1、3.5.2下载地址。 建议的3.5.1 下载地址:http: //www .oldapps.com /filezilla .php?old_filezilla=6350 |