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.

相关推荐
jzhwolp6 分钟前
nginx epoll 里黑科技位运算+指针复用
linux·nginx·架构
岸边的风20 分钟前
FileRise 让文件管理变简单,搭配cpolar实现远程自由访问
服务器
NON-JUDGMENTAL27 分钟前
在 Ubuntu 上安装 Ollama 并通过 Open WebUI 运行本地大语言模型
linux·ubuntu·语言模型
ZzzZZzzzZZZzzzz…41 分钟前
RHCSA---权限管理
linux·运维·权限管理·特殊权限·rhcsa·acl权限·权限掩码原理
TinyPiXOS开发者联盟44 分钟前
轻量级嵌入式系统的 Lottie 动画实现
linux·c++·动画·嵌入式开发·lottie·tinypixos·tpgui
海蓝可知天湛1 小时前
Ubuntu24.10禁用该源...+vmware无法复制黏贴“天坑闭环”——从 DNS 诡异解析到 Ubuntu EOL 引发的 apt 404排除折
linux·ubuntu
Tinyundg1 小时前
WinSCP的简单使用与SFTP自动备份 .bat脚本
运维·服务器
啊吧怪不啊吧1 小时前
SQL之表的时间类内置函数详解
大数据·服务器·数据库·sql
SoulKuyan2 小时前
android su执行命令
linux·运维·服务器
Zhao_yani2 小时前
Centos 7安装Apache Drill
linux·centos·drill