-
一、概要近日,华为云关注到SolarWinds官方发布安全公告,披露其产品Serv-U Managed File Transfer Server 及 Serv-U Secured FTP存在远程代码执行漏洞(CVE-2021-35211),成功利用此漏洞的攻击者可以使用特权运行任意代码;安装程序;查看、更改或删除数据;在受影响的系统上运行程序。目前业界已存在在野攻击利用,风险较高。SolarWinds Serv-U是一款广泛使用的FTP服务器软件。华为云提醒使用SolarWinds Serv-U的用户及时安排自检并做好安全加固以降低安全风险。参考链接:https://www.solarwinds.com/trust-center/security-advisories/cve-2021-35211二、漏洞级别漏洞级别:【严重】(说明:漏洞级别共四级:一般、重要、严重、紧急)三、影响范围影响版本:SolarWinds Serv-U <= 15.2.3 HF1 安全版本:SolarWinds Serv-U 15.2.3 HF2四、安全建议目前官方已在新版本中修复了该漏洞,请受影响的用户及时升级至安全版本。https://support.solarwinds.com/SuccessCenter/s/article/Serv-U-15-2-3-HotFix-2如果暂时无法升级,可关闭SSH功能进行缓解。注意:修复漏洞前请将资料备份,并进行充分测试。
-
【功能模块】https://www.mindspore.cn/tutorial/training/zh-CN/r1.2/use/publish_model.html如题:想发布模型到MindSpore_hub上所需asset-link的地址可以是百度网盘吗,除http服务可以访问以外ftp服务行吗???【操作步骤&问题现象】1、我训练了一个模型,想要按照官方说明上传到MindSpore_hub上面,但是看到其中需要给出asset-link的地址,而我本身并没有公网IP的http服务器来存放模型文件,因此也就难以给出http服务可以访问的asset-link的地址, 这里我的问题是我可以不可以把模型文件上传到百度云盘上,然后给出百度云盘的地址和提取码呢,这样是否可行???【截图信息】【日志信息】(可选,上传日志内容或者附件)
-
云社区 博客 博客详情配置tftp服务 仙女本仙 发表于 2021-06-23 11:14:02 2 0 0编辑删除FTPTCP/IP通用安全【摘要】 FTP (File Tranfor Protocol) 即远程文件传输协议,是一个用于简化IP网络上系统之间文件传送的协议。它的任务是将文件从一台计算机传送到另一台计算机,它与这两台计算机所处的位置、联接的方式,甚至是否使用相同的操作系统无关。TFTP (Trivial File Transfer Protocol,简单文件传输协议)是TCP/IP协议族中的一个用来在客户机与服务器之间进行简...FTP (File Tranfor Protocol) 即远程文件传输协议,是一个用于简化IP网络上系统之间文件传送的协议。它的任务是将文件从一台计算机传送到另一台计算机,它与这两台计算机所处的位置、联接的方式,甚至是否使用相同的操作系统无关。TFTP (Trivial File Transfer Protocol,简单文件传输协议)是TCP/IP协议族中的一个用来在客户机与服务器之间进行简单文件传输的协议,提供不复杂、开销不大的文件传输服务TFTP是一个传输文件的简单协议,它基于UDP协议而实现,有些TFTP协议是基于其他传输协议完成的TFTP设计时是用于进行小文件传输的,因此它不具备通常的FTP的许多功能,它只能从文件服务器上获得或写入文件,不能列出目录,不进行认证,它传输8位数据。传输中有三种模式: netasci,这是8位的ASCI码形式;第二种是octet,这是8位源数据类型;第三种mail已经不再支持,它将返回的数据直接返回给用户面不是保存为文件。TFTP的应用包括下列两个。为无盘工作站下载引导文件,下载初始化代码到打印机、集线器和路由器。例如,存在这样的设备,它拥有一个网络连接和小容量的固化了TFTP, UDP和IP的只读存储器(Read-Only Memory, ROM)。加电后,设备执行ROM中的代码,在网络上广播一个TFTP请求。网络上的TFTP服务器响应请求包含可执行二进制程序的文件,设备收到文件后,将它载入内存,然后开始运行程序。路由器的信息设置。路由器可以在指定的TFTP服务器上存储设置参数,如果这个路由器瘫痪了,正确的设置信息可以从TFTP服务器上下载到一个修复的路由器或者一个替代的路由器,这便为路由器提供了一种容错能力FTP可用多种格式传输文件,通常由系统决定,大多数系统(包括UNIX系统)只有两种模式:文本模式(asci)和二进制模式(binary)。文本传输器使用ASCI字符,并由(Enter)键和换行符分开。而二进制不用转换或格式化就可传字符,二进制模式比文本模式更快,并且可以传输所有ASCI值,所以系统管理员一般将FTP设置成二进制模式FTP支持两种模式,一种是Prot (也称Standard方式,主动方式),一种是Passive (也称Pasv方式,被动方式).1. Port模式FTP客户端首先动态地选择一个端口和FTP服务器的TCP 21端口建立连接,通过这个通道发送命令,客户端需要接收数据时在这个通道上发送Port命令。Port命令包含了客户端用什么端口接收数据。在传送数据时,服务器端通过自己的TCP 20端口连接至客户端的指定端口发送数据。FTP Server必须和客户端建立一个新的连接用来传送数据。2. Passive模式在建立控制通道时和Standard模式类似,但建立连接后发送的不是Port命令,而是Pasv命, FTP服务器收到Pasv命令后,随机打开一个高端端口(端口号大于1024),并且通知客户端在这个端口上传送数据的请求,客户端连接FTP服务器的这个端口,然后FTP服务器将通过这个端口进行数据的传送,这时FTP Server不再需要建立一个新的和客户端之间的连接。Linux下有好几款很不错的FTP Server,各有特点,适用于不同的应用场合。根据其可配置性大概可以分为3类:弱、中等、高。功能比较简单的有tipd和oftpd,前者与FTP客户端工具FTP类似,只有标准的功能,此外支持SSL, ofipd是一款非常小巧的匿名FTP服务器可配制型居中的主要是vstipd和pure-fipd,这两个侧重于安全、速度和轻量级,在大型FTP服务器上用得比较多,尤其是vsftpd,这类服务器对用户认证和权限控制比较简单,更注重安全和速度。它们都支持虚拟用户,但用户权限依赖于文件的系统权限,不支持针对目录的权限配置,在配置依赖于目录的权限时很麻烦。 pure-ftpd相对vsftpd要强大一些,支持的用户认证方式也比较多。配置性强的要数profipd, wu-fipd和glftpdo, proftpd的配置方式跟Apache非常类似,支持虚拟服务器,可针对目录和虚拟用户进行权限配制,可继承和覆盖,还支持类似于.htaccess的. ftpaccess,此外还有众多模块可以帮助实现一些特定的功能。wu-ftpd可以说是proftpd的前身,在早期用得比较多, profipd就是针对wu-ftpd一些致命的弱点,重新写的同样定位的FTP服务器,差不多可以取代wu-fipd, gllipd也是以功能强大著称,可配置性非常强,能够完成一些很独特的任务,比如自动CRC校验等。由于这几款软件过于强大,存在不少安全隐患,需要经常打补丁。在嵌人式开发过程中, TFTP服务器是工作于宿主机上的软件,主要提供对目标机的主要映像文件的下载工作,避免了频繁的U盘复制的过程。Linux下的tp开发环境建立包括两个方面:一是Linux服务器端的tp-server支持,二是嵌入式目标系统的fp-elient支持。下面将介绍Linux服务器端ttp-server的配置和在主机和目标机之间的tip文件传输方法。与FTP不同的是,它使用的是UDP的69端口,因此可以穿越许多防火墙。不过它也有缺点,比如传送不可靠、没有密码验证等虽然如此他还是非常适合传送小型文件的
-
首先换源: sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak sudo gedit /etc/apt/sources.list deb http://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu bionic main multiverse restricted universe deb http://cn.archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe deb http://cn.archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe deb http://cn.archive.ubuntu.com/ubuntu bionic main multiverse restricted universe更新源sudo apt-get update安装vsftpdsudo apt-get install vsftpd修改文件sudo gedit /etc/vsftpd.conf修改内容为,直接复制,覆盖原有代码 # 禁止匿名用户登录 anonymous_enable=NO # 允许系统用户登录 local_enable=YES # 启用可以修改文件的 FTP 命令 write_enable=YES # 本地用户创建文件的 umask 值 local_umask=022 # 允许为目录配置显示信息,显示每个目录下面的message_file文件的内容 dirmessage_enable=YES # 开启日记功能 xferlog_enable=YES # 使用标准的20端口来连接ftp connect_from_port_20=YES # 使用标准日志格式 xferlog_std_format=YES # 如果启动这项功能,则所有列在chroot_list_file之中的使用者不能更改根目录 chroot_list_enable=YES # 指定限制的用户文件 chroot_list_file=/etc/vsftpd/chroot_list # ftp服务器将处于独立启动模式 listen=YES # 设置一个本地用户登录后进入到的目录 local_root=/home/ftp # 设置PAM认证服务的配置文件名称,该文件保存在“/etc/pam.d/”目录下 pam_service_name=vsftpd # ftp将检查userlist_file设置文件中指定的用户是否可以访问vsftpd服务器 userlist_enable=YES # 只允许user_list文件中记录的ftp用户能登录vsftp服务,其他的ftp用户都不可以登录。 userlist_deny=NO # 定义限制/允许用户登录的文件 userlist_file=/etc/vsftpd/allowed_users # ftp服务器将使用tcp_wrappers作为主机访问控制模式 tcp_wrappers=YES # 连接ftp服务费使用的端口 listen_port=21创建文件夹和文件 sudo mkdir /etc/vsftpd cd /etc/vsftpd sudo touch chroot_list sudo touch allowed_users创建FTP根目录,并添加目录权限 sudo mkdir /home/ftp sudo chmod -R 777 /home/ftp添加用户,密码 sudo useradd -d /home/ftp -s /sbin/nologin chuangxin sudo passwd chuangxin在/etc/shells文件末尾添加sudo gedit /etc/shells添加到末尾/sbin/nologin添加用户到/etc/vsftpd/allowed_users sudo gedit /etc/vsftpd/allowed_users chuangxin重启vsftpd服务service vsftpd restart查看vsftpd服务状态,绿灯表示正常连接service vsftpd status查看本机局域网ipifconfig测试ftp连接ftp 19.168.x.x连接成功返回:230 Login successful
-
华为边缘计算网关的文件传输功能因为安全漏洞修复的原因,将文件传输工具由curl升级为FTP/SFTP,对应产品及版本的配套关系如下:设备款型Curl工具配套版本关系FTP工具配套版本关系Hi-Grid T1V200R19C10SPC300及之前的版本NAEC-Core-L1V200R19C10SPC300及之前的版本NAAR-Core-220eV200R19C10SPC300及之前的版本V200R20C00SPC100及之后的版本AR502H系列V200R19C10SPC300及之前的版本V200R20C00SPC100及之后的版本工具差异点:1、Curl命令行无需交互,支持一条命令行完成文件传输;2、FTP命令行一般需要交互,无法一条命令行完成文件传输。基于以上差异,部分合作伙伴反馈使用切换至FTP工具的版本后,影响产线生产效率。为解决此问题,提供交互式脚本解决方案,脚本示例:#!/bin/sh ftp 120.63.196.29 << EOF 1 1 get 1.txt q EOF使用效果示例:
-
平时工作中需要访问FTP服务器,这个时候FTP客户端就十分实用了,中标麒麟自带有FTP客户端,可连接到FTP服务器上,可以进行文件的上传、下载。1、开始菜单,点击所有应用,点击互联网,找到FTP客户端这个工具,打开。(或者直接打开开始菜单从搜索框直接搜索FTP客户端)。如下图所示:2、输入主机、用户名和密码,就可以快速连接到FTP服务器了,如下图所示,是我连接到我所建立的一个FTP服务器。(ps:想学习如何建立FTP服务器的同学们,可以参考:新手小白也能学会的Ubuntu搭建vsftpd服务器,学起来!)3、可以看到FTP左边部分为本地站点,我们可以上传本地的文档到FTP服务器上;右边部分为远程站点,也可以让我们下载FTP服务器上的文档。4、在页签上点击文件,可以看到有个站点管理器。我们也可以通过FTP客户端管理新站点。
-
一个稳定且功能齐全的FTP客户端工具可以提高我们的工作效率,银河麒麟自带有FTP客户端,可连接到FTP服务器上,可以进行文件的上传、下载。1、开始菜单搜索FTP客户端,打开FTP客户端,界面如下,输入主机、用户名和密码,就可以快速连接到FTP服务器了。右部是远程站点,可以下载ftp服务器上的文件,也可以创建目录。左部是本地站点,可以上传本地的文档到ftp服务器。在菜单栏点击“传输”,可以选择“手动传输”。此外,还可以对传输的速度进行限制,在菜单栏点击“传输”,可以选择“速度限制”。
-
工具概述文件传输协议(File Transfer Protocol,FTP)当前广泛应用于个人和企业场景,而随着使用时间越来越长,用户越来越多,本地搭建的FTP服务器都会面临空间使用量增长过快,扩容成本高等问题,增加了IT运维管理的难度。华为云的obsftp工具利用pyftpdlib库的FTP server能力和对象存储云端存储能力,提供出具有FTP接入的云上存储使用能力,提供给FTP近乎无限的存储空间。在企业实际业务中,无需单独搭建FTP服务器和存储池,实现业务和运维的轻量化,极大降低了原有的FTP访问方式的技术成本,完美解决了FTP场景下的存储问题,使数据存储和访问不再困难。工具说明工具下载地址:https://github.com/huaweicloud-obs/obsftp功能特性说明:FTP基本的数据上传、下载、删除能力无损支持。后端数据传输支持HTTP/HTTPS两种模式,在兼容性和安全性上提供更多选择。使用不同桶进行不同服务的数据存储,利于业务规划和运维。支持多个FTP客户端挂载使用。一般4核8GB内存的X86服务器可支撑200个以上客户端同时操作。多操作系统支持:支持32/64位Windows、Linux和Mac操作系统。免安装&配置:拥有默认配置,解压后直接启动使用。开源透明:obsftp工具使用Python语言编程,完整的源代码可直接在GitHub获取;可以根据自己的业务诉求进行灵活的二次开发和改造。约束与限制由于FTP协议为明文传输,为了数据的安全性建议将obsftp工具和FTP Client运行在同一台主机上,通过127.0.0.1:port地址来访问规避FTP协议的不安全性。工具包需要解压在以ASCII码支持的字符(即英文与数字、_等)组成的目录下。obsftp对运行环境中的Python版本要求为2.7.9及以上的2.7系列。obsftp工具因FTP协议限制,单个客户端上传大量数据不会并发进行,因此如有大规模数据处理上云建议使用obsutil等工具或使用OBS SDK进行软件开发实现。安装和使用前提条件在使用本工具前,您需完成华为云帐号注册,开通OBS,并创建一个可用的桶。已下载obsftp工具。工具下载地址:https://github.com/huaweicloud-obs/obsftp在Windows上使用此工具前需要您先完成Python安装。Python工具获取地址:https://www.python.org/downloads/release/python-2715/Python安装指导:以普通Windows程序默认安装方式运行安装即可。操作步骤将obsftp工具包解压到ASCII码支持的字符即英文与数字、_等组成的目录下。按“Windows+R”打开运行窗口,输入cmd命令,按“Enter”,打开CMD命令窗口。在CMD命令窗口进入obsftp工具所在目录,执行以下命令,启动obsftp工具。python FTPServerStart.py python FTPServerStart.py --help FTPServerStart.py [options] -h, --help show this help message and exit --masquerade_address=MASQUERADE_ADDRESS the ip that will reply to FTP Client, then client will send data request to this address. --listen_address=LISTEN_ADDRESS the address which ftpserver will listen, default is 127.0.0.1 --port=PORT the local port which ftpserver will listen, default is 10020 --loglevel=LOGLEVEL DEBUG/INFO/ --passive_ports_start==PASSIVE_PORTS_START the start port of passive ports when transefer data,must be >=1 --passive_ports_end==PASSIVE_PORTS_END the end port of passive ports when transefer data,must be <=65535
-
Win10搭建ftp(含设置用户名和密码)测试成功1、打开ftp服务方法:win+R输入control打开控制面板点击程序与功能→启动或关闭Windows功能,选择一下选项,打开ftp服务2、打开Internet信息服务(IIS)管理器方法:win+R输入inetmgr打开iss管理器1)、网站—>添加FTP站点…—>站点信息2)、输入IP和端口号,IP就是自己电脑的ip,端口号最好改一下,21端口有可能被占用。查看自己主机ip:Win+R—>cmd—>ipconfig3)、身份验证和授权信息3、关闭防火墙或设置启用防火墙允许ftp通过防火墙1)、关闭防火墙2)、启用防火墙允许ftp通过防火墙4、测试5、设置用户名和密码登陆为FTP登陆验证新建一个登录用户test右键此电脑→管理6、为FTP设置登录验证1)、FTP身份验证,将匿名身份验证禁用2)、FTP授权规则,添加允许授权规则3)、登陆游览器测试到此,一个需要输入用户名和密码的FTP已经搭建完成。转载自:Win10搭建ftp(含设置用户名和密码)测试成功!!!
-
这两天需要使用ftp服务器进行测试,在网上看了很多关于Ubuntu搭建vsftpd的安装配置教程,经过多次尝试,终于搞定!因此总结了一个Ubuntu搭建vsftpd服务器的设置方法,大家有需要的就赶快学起来吧!新手小白也可以学习哦!№1、安装vsftp,命令如下:sudo apt-get install vsftpd注:在终端输入这句命令,有可能会提示-“无法定位到软件包 vsftpd”,有可能是在局域网内没有配置DNS域名,需自己手动配置DNS。№2、修改配置文件(在修改之前最好做一下备份,命令:sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.cp)sudo vim /etc/vsftpd.conf就会弹出一个文件编辑界面,这个就是vi编辑界面,此时,我们就能使用vi的基本命令来操作该文件了。(vi的常用命令可以百度自己查查看看哦~)具体的配置文件如下(按红色字体修改配置):# Example config file /etc/vsftpd.conf## The default compiled in settings are fairly paranoid. This sample file# loosens things up a bit, to make the ftp daemon more usable.# Please see vsftpd.conf.5 for all compiled in defaults.## READ THIS: This example file is NOT an exhaustive list of vsftpd options.# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's# capabilities.### Run standalone? vsftpd can run either from an inetd or as a standalone# daemon started from an initscript.listen=NO## This directive enables listening on IPv6 sockets. By default, listening# on the IPv6 "any" address (::) will accept connections from both IPv6# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6# sockets. If you want that (perhaps because you want to listen on specific# addresses) then you must run two copies of vsftpd with two configuration# files.listen_ipv6=YES## Allow anonymous FTP? (Disabled by default).#这个是设置是否允许匿名登录ftp服务器,不允许。anonymous_enable=NO ## Uncomment this to allow local users to log in.#是否允许本机用户登录local_enable=YES## Uncomment this to enable any form of FTP write command.#允许上传文件到ftp服务器write_enable=YES## Default umask for local users is 077. You may wish to change this to 022,# if your users expect that (022 is used by most other ftpd's)#local_umask=022## Uncomment this to allow the anonymous FTP user to upload files. This only# has an effect if the above global write enable is activated. Also, you will# obviously need to create a directory writable by the FTP user.#anon_upload_enable=YES## Uncomment this if you want the anonymous FTP user to be able to create# new directories.#anon_mkdir_write_enable=YES## Activate directory messages - messages given to remote users when they# go into a certain directory.dirmessage_enable=YES## If enabled, vsftpd will display directory listings with the time# in your local time zone. The default is to display GMT. The# times returned by the MDTM FTP command are also affected by this# option.use_localtime=YES## Activate logging of uploads/downloads.# 一个存有详细的上传和下载信息的日志文件xferlog_enable=YES ## Make sure PORT transfer connections originate from port 20 (ftp-data)# 在服务器上针对 PORT 类型的连接使用端口 20(FTP 数据).connect_from_port_20=YES ## If you want, you can arrange for uploaded anonymous files to be owned by# a different user. Note! Using "root" for uploaded files is not# recommended!#chown_uploads=YES#chown_username=whoever## You may override where the log file goes if you like. The default is shown# below.#xferlog_file=/var/log/vsftpd.log## If you want, you can have your log file in standard ftpd xferlog format.# Note that the default log file location is /var/log/xferlog in this case.#xferlog_std_format=YES## You may change the default value for timing out an idle session.#idle_session_timeout=600## You may change the default value for timing out a data connection.#data_connection_timeout=120## It is recommended that you define on your system a unique user which the# ftp server can use as a totally isolated and unprivileged user.#nopriv_user=ftpsecure## Enable this and the server will recognise asynchronous ABOR requests. Not# recommended for security (the code is non-trivial). Not enabling it,# however, may confuse older FTP clients.#async_abor_enable=YES## By default the server will pretend to allow ASCII mode but in fact ignore# the request. Turn on the below options to have the server actually do ASCII# mangling on files when in ASCII mode.# Beware that on some FTP servers, ASCII support allows a denial of service# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd# predicted this attack and has always been safe, reporting the size of the# raw file.# ASCII mangling is a horrible feature of the protocol.#ascii_upload_enable=YES#ascii_download_enable=YES## You may fully customise the login banner string:#ftpd_banner=Welcome to blah FTP service.## You may specify a file of disallowed anonymous e-mail addresses. Apparently# useful for combatting certain DoS attacks.#deny_email_enable=YES# (default follows)#banned_email_file=/etc/vsftpd.banned_emails## You may restrict local users to their home directories. See the FAQ for# the possible risks in this before using chroot_local_user or# chroot_list_enable below.#chroot_local_user=YES## You may specify an explicit list of local users to chroot() to their home# directory. If chroot_local_user is YES, then this list becomes a list of# users to NOT chroot().# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that# the user does not have write access to the top level directory within the# chroot)chroot_local_user=YESchroot_list_enable=YES# (default follows) 允许chroot_list文件中配置的用户登录此ftp服务器。chroot_list_file=/etc/vsftpd.chroot_list# You may activate the "-R" option to the builtin ls. This is disabled by# default to avoid remote users being able to cause excessive I/O on large# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume# the presence of the "-R" option, so there is a strong case for enabling it.#ls_recurse_enable=YES## Customization## Some of vsftpd's settings don't fit the filesystem layout by# default.## This option should be the name of a directory which is empty. Also, the# directory should not be writable by the ftp user. This directory is used# as a secure chroot() jail at times vsftpd does not require filesystem# access.secure_chroot_dir=/var/run/vsftpd/empty## This string is the name of the PAM service vsftpd will use.pam_service_name=vsftpd ## This option specifies the location of the RSA certificate to use for SSL# encrypted connections.rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pemrsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.keyssl_enable=NO## Uncomment this to indicate that vsftpd use a utf8 filesystem.#utf8_filesystem=YES#配置ftp服务器的上传下载文件所在的目录。local_root=/home/python/ftpfile#this directory is for ftp server to save download or upload data№3、创建一个用户名:ftpusersudo useradd -d /home/ftp -s /bin/bash ftpuser№4、给新创建的ftpuser设置密码,需输入两次:sudo passwd ftpuser№5、创建ftpuser的家目录并将其所属用户和所属组改为ftpusersudo mkdir /home/ftpsudo chown ftpuser:ftpuser /home/ftp№6、修改 /home/ftp权限(因为要在里面创建Down和Up目录,且其不能被ftpusers删除,所以应该限制 /home/ftp 写权限)sudo chmod 555 /home/ftp№7、这里在 /home/ftp下创建Down 和Up目录,Down仅可下载,Up可下载、上传、删除。sudo mkdir /home/ftp/Down sudo chown ftpuser:ftpuser /home/ftp/Down #同样需要修改其用户组和拥有者为 ftpusersudo mkdir /home/ftp/Upsudo chown ftpuser:ftpuser /home/ftp/Upsudo chmod 555 /home/ftp/Down #修改 Down 目录下文件仅仅能下载sudo chmod 777 /home/ftp/Up #修改 Up 目录下能下载、上传、删除№8、创建vsftpd.chroot_list文件并添加可ftp的用户sudo vim /etc/vsftpd.chroot_list这时会出现vi编辑框,就在里面添加可登录ftp的用户,我这边添加的就是ftpuser啦。还可以添加一些本地的其他用户。№9、配置好vsftpd后,我们就可以重新启动它了sudo service vsftpd restart还可以查看ftp的状态,命令如下: sudo service vsftpd status№10、经过上面的步骤,我们就大致完成了有关vsftpd的安装以及配置。接下来,我们就来测试下用户能否连接至vsftpd服务中。首先查看Ubuntu上的ip地址,在终端中输入 sudo ifconfig就可以查看ip地址了(如下红框)根据上面的ip地址,在浏览器内输入ftp://+ip地址就可以访问啦!!按照上述步骤,Ubuntu搭建vsftpd的就成功啦!
-
一、需求: 某数据公司每日15:00~17:00之间,在其FTP发布当日数据供下载,我方需及时下载当日数据至指定本地目录。二、分析: 1、需实现FTP登陆、查询、下载功能; 解答:使用内置的ftplib模块中FTP类; 2、需判断文件是否下载; 解答:使用os模块中path.exists方法; 3、需判断在指定时间段内才执行下载任务; 解答:使用内置的time模块抓取当前时间,并与指定时间做比较; 4、需考虑日期切换问题; 解答:使用内置的time模块抓取当前日期,并与变量中的日期做比较。三、代码实现123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384#!/usr/bin/env python# _*_ coding:utf-8 _*_ '''@Time : 2019-11-11 13:30@Author : Peanut_C@FileName: ftp_auto_download.py''' import timefrom ftplib import FTPimport os remote_path = "/xxx/yy/z/" # 远端目录begin_time = 1500 # 任务开始时间end_time = 1700 # 任务结束时间 today = time.strftime("%Y%m%d") # 当天日期today_file = today + 'test.txt' # 得到当天日期的目标文件名remote_file = remote_path + today_file # 远端文件名local_file = '\\\\local\\' + today + '\\' + today_file # 本地文件名log_file = 'C:\\\\log\\ftp_log.txt' def ftp_connect(): """用于FTP连接""" ftp_server = 'w.x.y.z' # ftp站点对应的IP地址 username = 'ftpuser' # 用户名 password = 'ftppass' # 密码 ftp = FTP() ftp.set_debuglevel(0) # 较高的级别方便排查问题 ftp.connect(ftp_server, 21) ftp.login(username, password) return ftp def remote_file_exists(): """用于FTP站点目标文件存在检测""" ftp = ftp_connect() ftp.cwd(remote_path) # 进入目标目录 remote_file_names = ftp.nlst() # 获取文件列表 ftp.quit() if today_file in remote_file_names: return True else: return False def download_file(): """用于目标文件下载""" ftp = ftp_connect() bufsize = 1024 fp = open(local_file, 'wb') ftp.set_debuglevel(0) # 较高的级别方便排查问题 ftp.retrbinary('RETR ' + remote_file, fp.write, bufsize) fp.close() ftp.quit() while True: if int(time.strftime("%H%M")) in range(begin_time, end_time): # 判断是否在执行时间范围 if int(time.strftime("%Y%m%d")) - int(today) == 0: # 判断是否跨日期 while not os.path.exists(local_file): # 判断本地是否已有文件 if remote_file_exists(): # 判断远端是否已有文件 download_file() with open(log_file, 'a') as f: f.write('\n' + time.strftime("%Y/%m/%d %H:%M:%S") + " 今日文件已下载!") time.sleep(60) # 下载完毕静默1分钟 else: time.sleep(180) break # 注意,此处跳出循环重新判断日期,避免周末或当天没文件时陷入内层循环 else: time.sleep(180) else: """如果跨日期,则根据当前日期,更新各文件日期""" today = time.strftime("%Y%m%d") # 当天日期 today_file = today + 'test.txt' # 得到当天日期的目标文件名 remote_file = remote_path + today_file # 远端文件名 local_file = '\\\\local\\' + today + '\\' + today_file # 本地文件名 with open(log_file, 'a') as f: f.write('\n' + time.strftime("%Y/%m/%d %H:%M:%S") + " 任务启动, 文件日期已更新。") else: time.sleep(1800)四、运行情况 保存为pyw文件,任务在后台持续运行,不需要计划任务,省心省力。 不用下载标记,一则较为简洁,二则本地文件如果被人误删或移动可自动重新下载。 日志中,每天仅写入任务启动和文件已下载标志,并记录对应时间,如有需要可再添加。 希望能帮到有需要的朋友。 多多指教!
-
组网需求如图1所示,Switch作为FTP服务器(172.16.104.110/24)为网络中的不同用户设置不同的访问权限:子网1(172.16.105.0/24)的所有用户在任意时间都可以访问FTP服务器。子网2(172.16.107.0/24)的所有用户只能在某一个时间范围内访问FTP服务器。其他用户不可以访问FTP服务器。已知Switch与各个子网之间路由可达,要求在Switch上进行配置,实现FTP服务器对客户端访问权限的设置。图1 应用基本ACL配置FTP服务器访问权限组网图配置思路采用如下的配置思路:在Switch上创建基本ACL,并通过配置基本ACL规则对网络中不同用户进行分类。在Switch上配置FTP基本功能。在Switch应用基本ACL为网络中的不同用户设置不同的访问权限。操作步骤配置时间段<HUAWEI> system-view[~HUAWEI] sysname Switch[*HUAWEI] commit[~Switch] time-range ftp-access from 0:0 2009/1/1 to 23:59 2011/12/31[*Switch] time-range ftp-access 14:00 to 18:00 off-day配置基本ACL[*Switch] acl number 2001[*Switch-acl4-basic-2001] rule permit source 172.16.105.0 0.0.0.255[*Switch-acl4-basic-2001] rule permit source 172.16.107.0 0.0.0.255 time-range ftp-access[*Switch-acl4-basic-2001] rule deny source any[*Switch-acl4-basic-2001] commit[~Switch-acl4-basic-2001] quit配置FTP基本功能[~Switch] ftp server enable[~Switch] ftp server source all-interface[*Switch] aaa[*Switch-aaa] local-user huawei password irreversible-cipher SetUesrPasswd@123[*Switch-aaa] local-user huawei level 3[*Switch-aaa] local-user huawei service-type ftp[*Switch-aaa] local-user huawei ftp-directory flash:[*Switch-aaa] commit[~Switch-aaa] quit配置FTP服务器访问权限[~Switch] ftp server acl 2001[*Switch] commit验证配置结果在子网1的Server A(172.16.105.111/24)上执行ftp 172.16.104.110命令,可以连接FTP服务器。2010年某个周一在子网2的Server B(172.16.107.111/24)上执行ftp 172.16.104.110命令,不能连接FTP服务器;2010年某个周六下午15:00在子网2的Server B(172.16.107.111/24)上执行ftp 172.16.104.110命令,可以连接FTP服务器。在Server C(10.10.10.1/24)上执行ftp 172.16.104.110命令,不能连接FTP服务器。配置文件# Switch的配置文件# sysname Switch# ftp server enable ftp server source all-interface ftp server acl 2001 # time-range ftp-access 14:00 to 18:00 off-day time-range ftp-access from 00:00 2009/1/1 to 23:59 2011/12/31 # acl number 2001 rule 5 permit source 172.16.105.0 0.0.0.255 rule 10 permit source 172.16.107.0 0.0.0.255 time-range ftp-access rule 15 deny # aaa local-user huawei password irreversible-cipher $1c$jq@D({%F%%$2_o]0cDbL0JfH-77MkA'g<A$.fCo::;5(,*&~}p($ local-user huawei service-type ftp local-user huawei level 3 local-user huawei ftp-directory flash: # return
-
问题描述1.Windows主机使用9000提供的FTP文件系统时,从FTP中下载文件提示当前的安全设置不允许从该位置下载文件。告警信息 处理过程1.该问题是由于Internet安全设置有问题导致的。2.打开IE浏览器>设置>Internet选项3.选择安全>自定义级别4.文件下载选择启用,点击确认即可。
-
注意:1、只有R19及以上版本的云LSW、云AP支持通过云管理控制器采集设备的日志,之前的老版本不支持。2、FW不支持通过云管理控制器采集设备的日志,只能通过搭建FTP服务器采集。3、当云LSW、云AP发生故障,比如离线等原因,那么可能就无法通过云管理控制器采集设备的日志,此时,可以通过搭建FTP服务器采集。4、另外:R19C10版本的控制器的远程命令行支持导出功能,部分信息可以通过这个导出查看。Login the service plane webpage use tenant accountClick Device Management pageClick Device name to enter Use command line button to enter the device(Not a must)Save logfile on the device use “save logfile” command in user view(Not a must)save logfile Create a data dictionary of the device,use the command as the picture follows:(Not a must)cd logfilesystem-viewdiagnoseinfo-center create logbook test.xmlquitquitdir choose Tools label and select “Device file system” tool.Double click logfile file folderClick download button in the Operation column and then they will store in FusionInsight Click download button in the Operation column in Download file list part另外:R19C10版本的控制器的远程命令行支持导出功能,如下图:
推荐直播
-
HDC深度解读系列 - Serverless与MCP融合创新,构建AI应用全新智能中枢2025/08/20 周三 16:30-18:00
张昆鹏 HCDG北京核心组代表
HDC2025期间,华为云展示了Serverless与MCP融合创新的解决方案,本期访谈直播,由华为云开发者专家(HCDE)兼华为云开发者社区组织HCDG北京核心组代表张鹏先生主持,华为云PaaS服务产品部 Serverless总监Ewen为大家深度解读华为云Serverless与MCP如何融合构建AI应用全新智能中枢
回顾中 -
关于RISC-V生态发展的思考2025/09/02 周二 17:00-18:00
中国科学院计算技术研究所副所长包云岗教授
中科院包云岗老师将在本次直播中,探讨处理器生态的关键要素及其联系,分享过去几年推动RISC-V生态建设实践过程中的经验与教训。
回顾中 -
一键搞定华为云万级资源,3步轻松管理企业成本2025/09/09 周二 15:00-16:00
阿言 华为云交易产品经理
本直播重点介绍如何一键续费万级资源,3步轻松管理成本,帮助提升日常管理效率!
回顾中
热门标签