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.

相关推荐
wggmrlee9 分钟前
RAG基于LangChain实现
linux·langchain
小码吃趴菜11 分钟前
服务器预约系统linux小项目-第六节课
运维·服务器
christine_rr13 分钟前
linux常用命令(3)压缩命令
linux
L_090718 分钟前
【Linux】实现简易 shell 程序
linux·bash
爱学习的程序媛18 分钟前
WSL2:Windows上运行Linux的完整指南
linux·运维·windows·ubuntu·wsl2
Yupureki24 分钟前
《Linux系统编程》20.常见程序设计模式
linux·服务器·c语言·c++·单例模式·建造者模式·责任链模式
M1nat0_26 分钟前
Linux基础 Ext 文件系统:从磁盘硬件到目录路径的全链路解析
linux·服务器·网络·数据库
AIminminHu26 分钟前
OpenGL渲染与几何内核那点事-项目实践理论补充(一-2-(3)-当你的协同CAD服务器面临“千人同屏”时:从单机优化到分布式高并发)
运维·服务器·分布式
moical28 分钟前
关于docker-compose启动elasticsearch:7.17.29报"permission denied": unknown错误解决
linux
s65166549630 分钟前
编译linux内核
linux