目录
|
说明
|
/usr/sbin/vsftpd
|
vsftpd的主程序
|
/etc/rc.d/init.d/vsftpd
|
启动vsftpd的脚本
|
/etc/vsftpd/vsftpd.conf
|
主配置文件
|
/etc/pam.d/vsftpd
|
PAM认证文件
|
/var/ftp
|
匿名用户主目录
|
/var/ftp/pub
|
匿名用户的下载目录
|
/etc/vsftpd/ftpusers
|
禁止使用vsftpd的用户列表文件
|
/etc/vsftpd/user_list
|
禁止或允许使用vsftpd的用户列表文件
|
以ftp匿名用户名登录ftp服务
- [root@ftp ~]# ftp 172.16.52.2
- Connected to 172.16.52.2.
- 220 (vsFTPd 2.0.5)
- 504 Unknown AUTH type.
- 504 Unknown AUTH type.
- KERBEROS_V4 rejected as an authentication type
- Name (172.16.52.2:root): ftp
- 331 Please specify the password.
- Password:
- 230 Login successful.
- Remote system type is UNIX.
- Using binary mode to transfer files.
上传文件
- #vim /var/ftp/upload/.message ####在文件中可以自己定义提示信息,这个过程略过
- #useradd luo
- #echo “luo” | passwd –stdin luo
- [root@ftp ~]# ftp 172.16.52.2
- Connected to 172.16.52.2.
- 220 (vsFTPd 2.0.5)
- 530 Please login with USER and PASS.
- 530 Please login with USER and PASS.
- KERBEROS_V4 rejected as an authentication type
- Name (172.16.52.2:root): luo
- 331 Please specify the password.
- Password:
- 230 Login successful.
- Remote system type is UNIX.
- Using binary mode to transfer files.
- ftp> pwd
- 257 "/"
- 设置userlist_deny=YES,并在/etc/vsftpd/user_list文件中添加系统用户luo
- [root@ftp ~]# ftp 172.16.52.2
- Connected to 172.16.52.2.
- 220 (vsFTPd 2.0.5)
- 530 Please login with USER and PASS.
- 530 Please login with USER and PASS.
- KERBEROS_V4 rejected as an authentication type
- Name (172.16.52.2:root): luo
- 530 Permission denied.
- Login failed.
- 设置userlist_deny=NO,表示除了user_list文件中的用户都不可以访问ftp服务
- [root@ftp ~]# ftp 172.16.52.2
- Connected to 172.16.52.2.
- 220 (vsFTPd 2.0.5)
- 530 Please login with USER and PASS.
- 530 Please login with USER and PASS.
- KERBEROS_V4 rejected as an authentication type
- Name (172.16.52.2:root): luo
- 331 Please specify the password.
- Password:
- 230 Login successful.
- Remote system type is UNIX.
- Using binary mode to transfer files.
- ###此时的系统用户luo还在user_list文件中,大家可以多设置几个系统用户测试一下
- ftp> lcd /etc
- Local directory now /etc
- ftp> put fstab
- local: fstab remote: fstab
- 227 Entering Passive Mode (172,16,52,2,41,90)
- 150 Ok to send data.
- 226 File receive OK.
- 608 bytes sent in 0.0002 seconds (2.9e+03 Kbytes/s)
- ftp> ls
- 227 Entering Passive Mode (172,16,52,2,151,90)
- 150 Here comes the directory listing.
- -rw-r--r-- 1 2531 2531 608 Apr 21 08:04 fstab
- ftp> pwd
- 257 "/"
- ftp> lcd /var
- Local directory now /var
- ftp> get fstab
- local: fstab remote: fstab
- 227 Entering Passive Mode (172,16,52,2,74,110)
- 150 Opening BINARY mode data connection for fstab (608 bytes).
- 226 File send OK.
- 608 bytes received in 0.00036 seconds (1.6e+03 Kbytes/s)
- ftp> ls
- 227 Entering Passive Mode (172,16,52,2,57,76)
- 150 Here comes the directory listing.
- -rw-r--r-- 1 2531 2531 608 Apr 21 08:04 fstab
- #cd /etc/pki/CA
- CA#(umask 077; openssl genrsa –key private/cakey.pem 2048)
- CA#mkdir newcerts certs crl
- CA#touch index.txt
- CA#echo 01 > serial
- #cd /etc/vsftpd
- vsftpd#mkdir ssl
- vsftpd#cd ssl
- ssl#(umask 077; openssl genrsa -out vsftpd.key 2048)
5.vsftpd签署申请证书请求,同时在配置文件/etc/pki/tls/openssl.cnf修改指定的目录
- #vim /etc/pki/tls/openssl.cnf
- dir = /etc/pki/CA
还可以使用openssl模拟客户端连接ftp服务器
9.安装客户端软件