Linux下FTP服务器搭建
Linux下FTP服务器搭建
- 一、FTP介绍
- 二、环境介绍
- 三、FTP服务端搭建步骤
- 1.安装相关软件包
- 2.启动FTP并检查状态
- 3.检查服务端口运行状态
- 4.修改FTP配置文件
- 5.关闭selinux及防火墙
- 三、客户端操作
- 1.安装软件包
- 2.查看客户端状态
- 四.客户端测试登录情况
- 1.使用客户端本地账号user1登录
- 2.测试上传下载文件
一、FTP介绍
FTP(File Transfer Protocol,文件传输协议) 是 TCP/IP 协议组中的协议之一。FTP协议包括两个组成部分,其一为FTP服务器,其二为FTP客户端。默认情况下FTP协议使用TCP端口中的 20和21这两个端口,其中20用于传输数据,21用于传输控制信息。但是,是否使用20作为传输数据的端口与FTP使用的传输模式有关,如果采用主动模式,那么数据传输端口就是20;如果采用被动模式,则具体最终使用哪个端口要服务器端和客户端协商决定。
二、环境介绍
FTP服务端:hostname为control IP:192.168.200.150
FTP客户端:hostname为node1 IP: 192.168.200.135
三、FTP服务端搭建步骤
1.安装相关软件包
[root@control ~]# yum -y install ftp.x86_64
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:01:45 ago on Tue 11 May 2021 06:57:05 PM CST.
Dependencies resolved.
====================================================================================================================================================================Package Arch Version Repository Size
====================================================================================================================================================================
Installing:ftp x86_64 0.17-78.el8 AppStream 70 kTransaction Summary
====================================================================================================================================================================
Install 1 PackageTotal size: 70 k
Installed size: 112 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transactionPreparing : 1/1 Installing : ftp-0.17-78.el8.x86_64 1/1 Running scriptlet: ftp-0.17-78.el8.x86_64 1/1 Verifying : ftp-0.17-78.el8.x86_64 1/1
Installed products updated.Installed:ftp-0.17-78.el8.x86_64 Complete!
2.启动FTP并检查状态
[root@control ~]# systemctl enable --now vsftpd
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.
[root@control ~]# systemctl status vsftpd
● vsftpd.service - Vsftpd ftp daemonLoaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled)Active: active (running) since Tue 2021-05-11 18:59:51 CST; 9s agoProcess: 2825 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)Main PID: 2826 (vsftpd)Tasks: 1 (limit: 24900)Memory: 864.0KCGroup: /system.slice/vsftpd.service└─2826 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.confMay 11 18:59:51 control systemd[1]: Starting Vsftpd ftp daemon...
May 11 18:59:51 control systemd[1]: Started Vsftpd ftp daemon.
3.检查服务端口运行状态
[root@control mail]# netstat -antup | grep ftp
tcp6 0 0 :::21 :::* LISTEN 2826/vsftpd
4.修改FTP配置文件
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=YES
listen_ipv6=NOpam_service_name=vsftpd
userlist_enable=YES
5.关闭selinux及防火墙
sed -i 's/SELINUX=enforcing/SELIUNUX=disabled/' /etc/selinux/configsystemctl stop firewalld.service
备注:
防火墙如果要开启,则可开启以下端口:
firewall-cmd --zone=public --add-port=20/tcp --permanent
firewall-cmd --zone=public --add-port=21/tcp --permanent
firewall-cmd --zone=public --add-port=22/tcp --permanent
firewall-cmd --zone=public --add-port=30000-35000/tcp --permanent
三、客户端操作
1.安装软件包
[root@node1 ~]# yum -y install lftp
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository AppStream is listed more than once in the configuration
Repository BaseOS is listed more than once in the configuration
ansiable 0.0 B/s | 0 B 00:00
Failed to synchronize cache for repo 'ansiable', ignoring this repo.
Last metadata expiration check: 0:00:17 ago on Tue 11 May 2021 07:04:23 PM CST.
Dependencies resolved.
====================================================================================================================================================================Package Arch Version Repository Size
====================================================================================================================================================================
Installing:lftp x86_64 4.8.4-1.el8 AppStream 885 kTransaction Summary
====================================================================================================================================================================
Install 1 PackageTotal size: 885 k
Installed size: 3.0 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transactionPreparing : 1/1 Installing : lftp-4.8.4-1.el8.x86_64 1/1 Running scriptlet: lftp-4.8.4-1.el8.x86_64 1/1 Verifying : lftp-4.8.4-1.el8.x86_64 1/1
Installed products updated.Installed:lftp-4.8.4-1.el8.x86_64 Complete!
2.查看客户端状态
[root@node1 ~]# ps -ef |grep ftp
root 1746 1745 0 18:56 ? 00:00:00 /usr/libexec/openssh/sftp-server
四.客户端测试登录情况
1.使用客户端本地账号user1登录
lftp 192.168.200.150:~> pwd
ftp://192.168.200.150
lftp 192.168.200.150:~> user user1
Password:
lftp user1@192.168.200.150:~> ls
-rw-r--r-- 1 0 0 3541 May 11 13:08 passwd
lftp user1@192.168.200.150:~> pwd
ftp://user1@192.168.200.150/%2Fhome/user1
2.测试上传下载文件
[root@node1 ~]# lftp 192.168.200.150
lftp 192.168.200.150:~> user user1
Password:
lftp user1@192.168.200.150:~> ls
-rw-r--r-- 1 0 0 3541 May 11 13:08 passwd
lftp user1@192.168.200.150:~> lcd /etc
lcd ok, local cwd=/etc
lftp user1@192.168.200.150:~> put group
1154 bytes transferred
lftp user1@192.168.200.150:~> get passwd
get: /etc/passwd: file already exists and xfer:clobber is unset
Linux下FTP服务器搭建相关推荐
- linux下ftp服务器搭建详解
总体搭建流程: 1.安装vsftpd 2.配置vsftpd.conf配置文件 3.启动vsftpd服务器(安装完后默认是启动的) 4.客户端发起连接 5.传递数据(上传,下载) 6.关闭连接 详解 1 ...
- suse ftp文件服务器搭建,SUSE下FTP服务器搭建
FTP(File Transfer Protocol),是TCP/IP网络上两台计算机传送文件的协议,是在TCP/IP网络和Internet上最早使用的协议之一,属于网络协议组的应 用层.FTP客户机 ...
- linux如何测试ftp服务器,linux下FTP服务器的搭建
1.FTP服务器的简介 关于ftp的介绍,大家也一定不陌生了.我就直接把百度百科上的介绍拿过来,和大家一起温习一下概念. FTP 是File Transfer Protocol(文件传输协议)的英文简 ...
- linux下svn服务器搭建及使用
文章目录 1. 安装svn客户端 2. 安装svn服务器 3. 在svn目录下创建版本库 4. 修改版本库配置文件 4.1 修改 authz 文件 4.2 设置密码 passwd 4.3 修改 svn ...
- linux的FTP服务器搭建及FTP服务器的入侵和防御
FTP 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为"文传协议".用于Internet上的控制文件的双向传输. 与大多数Internet服 ...
- linux下ftp服务器的搭建
http://www.cublog.cn/u3/93926/showart_1874130.html RHEL4中ftp服务器的搭建 首先修改配置文件使主机获得永久ip地址 # vi /etc/sys ...
- linux下ftp服务器的搭建与使用
1.vsftpd服务器的搭建 # yum -y install vsftpd lftp 2.搭建匿名访问ftp服务器,允许所有人上传和下载,并创建文件夹 # vim /etc/vsftpd/vsftp ...
- linux下FTP服务搭建(1)
1.FTP介绍: FTP (File Transfer Protocol,文件传输协议)主要用来文件传输,尤其适用于大文件传输,提供上传下载功能 FTP官方网站:https://filezilla-p ...
- linux 下ntp服务器,Linux下NTP服务器搭建(示例代码)
一.搭建准备 1.确定自己的时区 #date命令可以查看当前系统时间,中国的时区为CST.使用tzselect命令进行配置时区 配置文件的修改:/etc/sysconfig/clock 2.检查NTP ...
最新文章
- Matlab mean() mean2() std() 函数的使用
- (转).gitignore详解
- jar打包 剔除第三方依赖以及它的依赖_面试官:为什么Spring Boot的jar可以直接运行?...
- mysql bin 分析_mysql bin log 分析
- Go语言URL编码方案
- Excel VBS编程 命令详细介绍 详解
- 单片机STM32开发环境的安装
- android 计时器函数,如何在Android中设置计时器
- 计算机桌面定制操作,教程方法;12、设置桌面--电脑基础知识电脑技巧-琪琪词资源网...
- android摄氏度转为华氏温度
- 解决W5500,DHCP获取IP地址失败的问题,移植官方例程需要特别注意!!!
- 密码学总结(一) 数学常识
- 青龙面板2.8版本+Ninja 保姆级 服务器安装jd代挂教程——(二)
- Tomcat 部署多个SpringBoot 项目:ERROR org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter
- 接口电路——原理,应用,分类,处理过程
- 格式工厂去广告版|格式工厂(Format Factory)免费版下载 v4.8.0
- 屏幕色温自动调节小助手
- 两个集合相等的例题_集合的相等答案
- centos7 php oci,linux centos centos7 安装oci8和pdo_oci扩展
- FLASH制作全套装备(已测试)
热门文章
- scipy 图像处理(scipy.misc、scipy.ndimage)、matplotlib 图像处理
- Apache 2.4 配置多个虚拟主机的问题
- 前些天做的一个物联网架构三层扩展
- *45.程序的装入方式
- C语言内存泄露很严重该怎么办?这几招告诉你
- oracle终止dbms调度,Oracle使用DBMS_JOB创建的数据库作业,遇到数据库关闭状态的调度...
- java初始化实例化_java类的初始化和实例化区别
- java 图形用什么组件标题_java图形用户界面设计Swing常用组件(阅读).ppt
- springboot jar服务器运行后无法请求_Spring Boot微服务中Chaos Monkey的应用
- python字符垂直输出型烟雾机_python+opencv实现水平投影和垂直投影