kali 19.2 搭建ftp服务器
先来看一下版本信息:
Linux cat 4.19.0-kali4-amd64 #1 SMP Debian 4.19.28-2kali1 (2019-03-18) x86_64 GNU/Linux
现在正式开始搭建过程:
apt-get update
apt install vsftpd
然后我们来修改配置文件:vim /etc/vsftpd.conf(我这直接贴配置文件了)
# 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
#
# Run standalone with IPv6?
# Like the listen parameter, except vsftpd will listen on an IPv6 socket
# instead of an IPv4 one. This parameter and the listen parameter are mutually
# exclusive.
#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=cat
#
# 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
#chroot_list_enable=YES
# (default follows)
#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.pem
# This option specifies the location of the RSA key to use for SSL
# encrypted connections.
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.keyftp_username=nobody
需要注意的事情是,我的本次配置并不考虑匿名用户,所以...
anonymous_enable=NO
并且在监听的这个地方,将ipv6的监听关掉了
接下来就是配置用户跟用户组了,在配置文件中我配置了这两行以防止:500 OOPS: vsftpd: cannot locate user specified in 'chown_username':whoever这个问题(其实不是很难的问题)
#chown_uploads=YES
#chown_username=whoever
将以上两行的“#”注释符去掉,并在系统中新建一个whoever用户,或者whoever改成系统用户名,就比如说我的配置文件中是这样的:
chown_uploads=YES
chown_username=cat //这是我们将要新建的ftp用户
好了,接下来真的是新建用户跟组了
sudo groupadd ftpuser
sudo mkdir /home/cat
sudo useradd -g ftpuser cat
sudo passwd cat # 输入两次密码
#改下密码文件 /etc/passwd, 把/bin/sh改成/bin/bash
sudo vim /etc/passwd
cat:x:1005:1003::/home/cat:/bin/bash
#把家目录权限设好
sudo chown -v -R cat:ftpuser /home/cat/
sudo chmod -v -R 700 /home/cat/
然后记得重启一下服务:
root@cat:~# /etc/init.d/vsftpd restart
我们用命令行来测试一下:
root@cat:~# ftp 10.87.5.249
Connected to 10.87.5.249.
220 (vsFTPd 3.0.3)
Name (10.87.5.249:root): cat
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/home/cat" is the current directory
发现我们已经搭建好了,当前的路径就是/home/cat
个人学习的笔记,大佬勿喷......
kali 19.2 搭建ftp服务器相关推荐
- win10搭建FTP服务器
下面就给大家讲解Win10搭建FTP服务器的详细操作方法. 1.首先,我们在Cortana中搜索控制面板并进入: 2.在控制面板-程序中,点击启用或关闭Windows功能: 3.在FTP服务器.Web ...
- 《搭建FTP服务器》
1.CentOS 7.2 搭建FTP 服务器 内网离线安装FTP Server 外网在线安装FTP Server 注意:所有的安装方式都必须先进行设置快照(出现异常可以及时恢复到之前设置快照的环境) ...
- Win11如何搭建FTP服务器以实现快速传输文件?
Win11如何搭建FTP服务器以实现快速传输文件?## Win11如何搭建FTP服务器以实现快速传输文件?相信大家在工作或生活的过程中,都会碰到需要传输大文件的情况,像U盘.QQ文件传输助手等工具显然 ...
- python --搭建FTP服务器
一.了解FTP服务器 二.利用python搭建FTP服务器 1.安装 pyftpdlib 模块 2.找到pyftpdlib模块源文件所在目录 3.到 pyftpdlib目录下 4. 编写并运行FTP代 ...
- Win10如何搭建FTP服务器以实现快速传输文件
Win10如何搭建FTP服务器以实现快速传输文件?相信大家在工作或生活的过程中,都会碰到需要传输大文件的情况,像U盘.QQ文件传输助手等工具显然满足不了大文件的传输需求,传输速度非常非常的慢.很多时候 ...
- 中小型网络的域环境搭建--第五季(搭建FTP服务器)
<接第四季> 根据第一季里的域环境拓扑图,我这次来介绍怎样安装FTP服务器.FTP服务器(File Transfer Protocol Server)是在网络中提供文件存储和访问服务的计算 ...
- 在Windows2003下搭建FTP服务器
在Windows2003下搭建FTP服务器 Windows 2003 Standard Edition.Windows 2003 Enterprise Edition.Windows XP Pro ...
- Linux系统搭建FTP服务器
在Linux系统中搭建FTP服务器 一.搭建概述: 在Linux系统中搭建一台FTP服务器是很必要的,这个服务器只要你搭建成功以后就可以在这个服务器上存放一些你自己需要的一些软件.文档.手册等等.搭建 ...
- linux ftp服务器搭建及用户的分配,Linux搭建FTP服务器
1..FTP服务器有什么用 .FTP服务器是能够提供文件存储.访问的计算机,实现了文件共享. 2.FTP是什么 FTP是File Transfer Protocol(文件传输协议),是一种基于TCP的 ...
- windows 下使用 Filezilla server 搭建 ftp 服务器
windows 下使用 Filezilla server 搭建 ftp 服务器 1. Filezilla server 免费,开源, ftp 服务端 2. 下载安装, windows https:/ ...
最新文章
- 数据结构-String、char
- python【数据结构与算法】武松打虎问题(贪心)
- 电脑桌面锁屏怎么设置_华为手机总是莫名多出照片?这两个设置不关闭,内存再大也不够用...
- 802.1x认证EAP包结构
- 收集、报告或保存系统活动信息:sar命令
- 20145335 《信息安全系统设计基础》课程总结
- Linux struct itimerval用法
- 深入剖析Android音频(三)AudioPolicyService
- Linux-SHELL基本操作
- AdminLTE-2.4.10源码包
- 2029年会实现通用人工智能吗?Gary Marcus「叫板」马斯克:赌十万美元如何?
- 昨夜星辰昨夜风,只因见您在梦中
- 北航计算机考研机考,11北航计算机复试上机
- 随着计算机技术的快速发展,随着计算机技术的发展,计算机的应用范围也越来越广...
- linux下tcpdump抓包保存cap文件,使用Wireshark分析
- 分享71个PHP源代码总有一个是你想要的 分享71个PHP源代码,总有一款适合你
- wget 下载盯盘文件
- 《Java核心技术 ---- 基础知识》 ---- 第三章 java的基本程序设计结构
- 云创大数据入围“国家超级计算长沙中心2022年生态合作伙伴”
- Monash call:人工智能永远不可能真正智能