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.

相关推荐
!沧海@一粟!5 分钟前
麒麟Zabbix Agent安装配置全攻略
linux·服务器·zabbix
似水এ᭄往昔4 小时前
【Linux】自动化构建-make/Makefile
linux·运维·服务器·ubuntu
顶点多余5 小时前
Linux“信号“从硬件到软件详解
linux·运维·服务器
瀚高PG实验室6 小时前
rpm包安装报错:cannot open Packages index using db5 - Cannot allocate memory (12)
linux·运维·服务器·瀚高数据库
追风少年王大爷丶6 小时前
nginx 配置无域名访问拒绝
运维·服务器·nginx
AI+程序员在路上6 小时前
嵌入式软件技术大全
linux·开发语言·arm开发·单片机
black方块cxy6 小时前
实现一个输入框多个ip以逗号分隔最多20组,且ip不能重复
java·服务器·前端
Snasph6 小时前
在Ubuntu上进行端口转发
linux·运维·ubuntu
线束线缆组件品替网6 小时前
Amphenol RJE1Y22A53644401线束详解与替代网络线束选型指南
运维·服务器·网络·智能路由器·电脑·51单片机
TG_yunshuguoji7 小时前
阿里云代理商: 阿里云部署OpenClaw 个性化配置指南 3 大场景模板详解
服务器·阿里云·云计算·openclaw