Ubuntu离线安装Vsftp

news2024/10/6 4:05:52

 这是资源包:(14条消息) unbuntu-vsftp.server-Linux文档类资源-CSDN文库

一、安装vsftp

        将包解压,然后在解压报的目录下一键安装

dpkg -i *.deb // 安装所有
systemctl status vsftpd #查看运行状态
systemctl restart vsftpd  #重新启动vsftp

二、修改配置文件

        这是我的配置文件,如果第一次配置建议直接照搬

# 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=YES
#
# 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).
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.
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).
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=YES
local_root=/servicedata
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/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.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO

allow_writeable_chroot=YES
#
# Uncomment this to indicate that vsftpd use a utf8 filesystem.
#utf8_filesystem=YES

        需要在etc目录下建立一个文件 chroot_list,该文件内存放的是可以访问vsftp服务器的用户名

local_root=/servicedata 该配置决定了用户可以访问哪个文件夹,我设置的是/servicedata目录

 三、创建访问的用户

        在vsftp中没有用户是访问不了的,据说有匿名访问,但是为了服务器安全,没有设置相关的配置。

        创建一个访问服务器的用户

useradd -m -g viewer viewer  创建组用户

passwd 用户名  //设置用户密码

        将创建的用户写入chroot_list文件中,也可以将本地用户放进去。

         最后重启:systemctl restart vsftpd

四、测试

在另一台电脑上WIN+R打开命令板

输入用户名和密码

 出现230 login successful 表示成功登录

 输入ls可以看到当前文件目录下的所有资源

使用get可以获取某文件

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/593711.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【论文阅读公式推导1】连续体机器人的哈密尔顿动力学推导

推导了一下论文哈密尔顿原理的表达,原论文的计算公式是对的,记录一下。 Gravagne I A, Rahn C D, Walker I D. Good vibrations: a vibration damping setpoint controller for continuum robots[C]//Proceedings 2001 ICRA. IEEE International Confer…

[网站分享]

Element-ui Element - The worlds most popular Vue UI frameworkElement,一套为开发者、设计师和产品经理准备的基于 Vue 2.0 的桌面端组件库https://element.eleme.cn/#/zh-CN Vant Weapp Vant Weapp - 轻量、可靠的小程序 UI 组件库轻量、可靠的小程序 UI 组件…

没有数学基础可以学编程吗?

一、为什么学编程 这里我并不是问大家,是因为兴趣啊还是就业学编程。 而是,我想要学Python为了量化交易,或者我要处理表格。我想要学Java我就想自己建站。是否有这种非常明确的目标,有目标才能明确学习路线。 如果在这里&#…

大数据:HDFS操作的客户端big data tools和NFS

大数据:HDFS操作的客户端 2022找工作是学历、能力和运气的超强结合体,遇到寒冬,大厂不招人,可能很多算法学生都得去找开发,测开 测开的话,你就得学数据库,sql,oracle,尤…

Vue--》Vue3打造可扩展的项目管理系统后台的完整指南(三)

今天开始使用 vue3 ts 搭建一个项目管理的后台,因为文章会将项目的每一个地方代码的书写都会讲解到,所以本项目会分成好几篇文章进行讲解,我会在最后一篇文章中会将项目代码开源到我的GithHub上,大家可以自行去进行下载运行&…

Pytorch入门(二)神经网络的搭建

torch.nn中的nn全称为neural network,意思是神经网络,是torch中构建神经网络的模块。 文章目录 一、神经网络基本骨架二、认识卷积操作三、认识最大池化操作四、非线性激活五、线性层及其它层介绍六、简单的神经网络搭建七、简单的认识神经网络中的数值计算八、损失…

mmdetection训练coco数据集(继跑通后的一些工具使用)

(仅做个人过程记录的笔记) 1、生成中间件 可以选择评估方式 --eval ,对于 COCO 数据集,可选 bbox 、segm、proposal 。可以得到result.bbox.json文件 生成pkl文件:faster_rcnn.pkl python tools/test.py config.py …

利用栈和队列共同解决迷宫问题

文章目录 什么是迷宫问题?如何解决迷宫问题?DFS(深度优先搜索)BFS(广度优先搜索) 总结 什么是迷宫问题? 迷宫问题是一道经典的算法问题,旨在寻找一条从起点到终点的最短路径。通常迷…

games101作业6

作业要求 Render() in Renderer.cpp: 将你的光线生成过程粘贴到此处,并且按照新框 架更新相应调用的格式。Triangle::getIntersection in Triangle.hpp: 将你的光线-三角形相交函数 粘贴到此处,并且按照新框架更新相应相交信息的格式。 在本次编程练习中…

删除排序链表中的重复元素(java)

删除链表中的重复元素 leetcode 83 题 删除链表中的重复元素解题思路代码链表专题 leetcode 83 题 删除链表中的重复元素 leetcode 83 题 – 跳转链接 给定一个已排序的链表的头 head , 删除所有重复的元素,使每个元素只出现一次 。返回 已排序的链表 。…

Python numpy - 数组与矩阵的创建&运算

数组array 一 数组的创建 (至少两个数组)创建随机整数数组 a 和 b import numpy as np a np.random.randint(10,size20).reshape(4,5) b np.random.randint(10,size20).reshape(4,5) 二 数组常用函数 数组常用函数 函数作用unique(&…

Transformer part2

(179条消息) Transformer模型入门详解及代码实现_transformer模型代码-CSDN博客 transformer的encoder和decoder的差别 1. decoder包含两个 Multi-Head Attention 层。 decoder第一个 Multi-Head Attention 层采用了 Masked 操作。 为什么需要Mask处理 如何进行Mask处理 de…

【C#图解教程】第五章 类的基本概念

程序和类 类是一个能储存数据并执行代码的经过封装的数据结构,包含数据成员和函数成员,类内通常会包含逻辑上相关的数据和函数,所以类通常会代表真实世界或概念上的事物。 运行中的C#程序实质上是许多实例之间相互作用: 类的声…

ThingsBoard 前端项目内置部件开发

ThingsBoard 是目前 Github 上最流行的开源物联网平台(12.8k Star),可以实现物联网项目的快速开发、管理和扩展,是中小微企业物联网平台的不二之选。 本文介绍如何在 ThingsBoard 前端项目中开发内置的菜单导航部件。 内置相关部…

clickhouse简介

文章目录 1:简介1.1:CH是什么?1.2:CH优势1.3:架构设计 2:CH接口3:CH引擎1:数据库引擎3.1.1:mysql引擎 2:表引擎3.2.1:MergeTree3.2.2:集成引擎1&a…

电子合同签署协议开源版系统开发

电子合同签署协议开源版系统开发 H5TP6mysqlphp 源码开源不加密 以下是电子合同系统可能包含的功能列表: 用户注册和登录:用户可以注册并登录系统,以便创建、签署和管理合同。合同创建:用户可以创建新合同,包括填写合…

Web的基本漏洞--SQL注入漏洞

目录 一、SQL注入介绍 1.SQL注入漏洞原理 2.SQL注入漏洞的类型 3.SQL注入漏洞识别 4.攻击方式 5.SQL盲注 时间盲注 布尔盲注 报错盲注 6.SQL注入漏洞的危害 7.SQL注入漏洞的防范措施 8.SQL注入漏洞的绕过 一、SQL注入介绍 1.SQL注入漏洞原理 Web程序输入的数据传…

使用git rebase合并多次commit

目录 rebase的作用简要概括为:命令:解决冲突:遗留问题: rebase的作用简要概括为: 可以对某一段线性提交历史进行编辑、删除、复制、粘贴;因此,合理使用rebase命令可以使我们的提交历史干净、简…

docker安装php

在安装 php 之前,我们可以先查看一下我们的镜像: docker images 我这里是已经存在 php 镜像了,版本就是 TAG 显示的 8.1.16 如果没有镜像,则执行下面的命令,拉取 php 镜像: docker pull php:latest 请注…

MAYLAND HOME官网上线 | LTD家居家装行业案例分享

​一、公司介绍 在MAYLAND HOME,我们为我们对质量和服务的承诺感到自豪。我们相信我们的成功与客户的满意度直接相关,这就是为什么我们努力超越您的期望,我们承担的每一个项目。无论您是想升级您的家庭还是企业,我们都会在这里帮助…