ftp服务器搭建-安装、配置及验证

ftp服务器搭建-安装、配置及验证


#安装

sudo apt-get install vsftpd

#配置文件

复制代码
cat > /etc/vsftpd.conf  << "EOF"
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=ftp
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
local_root=/home/test            #需要建立 对应的root dir
EOF

#创建用户

复制代码
echo test  > /etc/vsftpd.chroot_list

#设置密码

复制代码
password test 

#建立主目录

复制代码
mkdir /home/test 
sudo chmod -R 777 /home/test 
touch test						#放一个测试文件 

#本地验证

复制代码
root@localhost:/home/ftp# ftp localhost
Connected to localhost.
220 (vsFTPd 3.0.5)
Name (localhost:root): test 
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
200 EPRT command successful. Consider using EPSV.
150 Here comes the directory listing.
-rw-r--r--    1 0        0              13 Nov 24 15:46 test
226 Directory send OK.
ftp> get test
local: test remote: test
200 EPRT command successful. Consider using EPSV.
150 Opening BINARY mode data connection for test (0 bytes).
226 Transfer complete.

The End.

相关推荐
MrSYJ9 小时前
Netty异常传播机制
java·服务器·netty
REDcker9 小时前
Linux Core Dump 配置与分析指南
linux·运维·服务器
IMPYLH9 小时前
Linux 的 chcon 命令
linux·运维·服务器
苦逼IT运维10 小时前
SVN 仓库目录迁移,仓库 “降级” 成子目录实战
linux·运维·ci/cd·svn·运维开发
阿拉斯攀登10 小时前
第 13 篇 输入设备驱动(触摸屏 / 按键)开发详解,Linux input 子系统全解析
android·linux·运维·驱动开发·rk3568·瑞芯微·rk安卓驱动
爱丽_10 小时前
TCP 三次握手与四次挥手
服务器·网络·tcp/ip
智能工业品检测-奇妙智能10 小时前
金属矿山安全智能AI视觉识别
服务器·人工智能·安全·openclaw·奇妙智能
bukeyiwanshui10 小时前
【无标题】
linux·运维·服务器
疯狂吧小飞牛10 小时前
Linux 多网卡同网段配置冲突问题
linux·运维·服务器
-ONLY-¥11 小时前
Nginx性能优化与监控全攻略
linux