# openssl req -x509 -days 365 -newkey rsa:2048 -nodes -keyout /etc/vsftpd/vsftpd.pem -out /etc/vsftpd/vsftpd.pem // 创建 SSL
Generating a 2048 bit RSA private key
.............................................+++
....+++
writing new private key to '/etc/vsftpd/vsftpd.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:cn // 国家
State or Province Name (full name) [Berkshire]:ln // 省
Locality Name (eg, city) [Newbury]:ltu // 城市
Organization Name (eg, company) [My Company Ltd]:soft // 组织
Organizational Unit Name (eg, section) []:network // 单位名称
Common Name (eg, your name or your server's hostname) []:localhost // 主机名称
Email Address []:
# chmod 600 vsftpd.pem // 授权权限
登录ftp
bash复制代码
# ftp 10.10.1.10 // 连接 ftp
Connected to 10.10.1.10.
220 欢迎登录shn'ftp服务器。
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (10.10.1.10:root): shnmftp1 // 登录
331 Please specify the password.
Password: // 密码
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls // 查看
227 Entering Passive Mode (10,10,1,10,247,9)
150 Here comes the directory listing.
-rw-r--r-- 1 0 0 0 May 13 06:14 m1
drwx------ 2 603 603 4096 May 20 03:31 shnm
226 Directory send OK.
ftp> get m1 /var/m99 // 下载
local: /var/m99 remote: m1
227 Entering Passive Mode (10,10,1,10,35,242)
150 Opening BINARY mode data connection for m1 (0 bytes).
226 File send OK.
ftp> put /var/m99 ./s99 // 上传
local: /var/m99 remote: ./s99
227 Entering Passive Mode (10,10,1,10,244,124)
150 Ok to send data.
226 File receive OK.
ftp> delete s99 // 删除
250 Delete operation successful.
ftp> quit // 退出
221 Goodbye.