之前用的 windows ,想用 ftp 连接阿里云的 centos 服务器,直接用 xshell 的 xftp 客户端就可以了,连 ftp 服务器都不用配置,换了 mac 之后,尼玛, mac 没有 xftp 的应用,只能自己在 centos 上搞一下 ftp 服务了,要不然没得玩啊~
使用vsftpd作为客户端程序vsftpd 是一款在 linux 发行版中最受推崇的 FTP 服务器程序。特点是小巧轻快,安全易用。
vsftpd 的名字代表”very secure FTP daemon”,安全是它的开发者 Chris Evans 考虑的首要问题之一。
在这个 FTP 服务器设计开发的最开始的时候,高安全性就是一个目标。
一分钟搞定 安装vsftpd yum install vsftpd设置开机启动 vsftpd ftp 服务 chkconfig vsftpd on
配置vsftpd 创建 ftp 登陆账户
创建 ftp 用户 reeoome ,主目录为 /var/www ,并且禁止登录 SSH 权限。
useradd -d /var/www -g ftp -s /sbin/nologin reeoome -p 888888888个8就是ftp账号的密码咯
打开 vsftpd 的配置文件: vim /etc/vsftpd/vsftpd.conf干掉匿名访问 anonymous_enable=NO
允许 ftp 用户进行登录验证 local_enable=YES
不允许FTP下载 download_enable=NO
只允许刚创建的 reeoome 登录 FTP userlist_enable=YES
userlist_deny=NO
然后打开:
vim /etc/vsftpd/user_list注释所有帐户,添加 reeoome
# vsftpd userlist# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
#root
#bin
#daemon
#adm
#lp
#sync
#shutdown
#halt
#news
#uucp
#operator
#games
#nobody
reeoome
到此就可以用 ftp 客户端来连接 ftp 服务器了,用户名 reeoome ,密码88888888。