ubuntu服务器安装FTP服务
ubuntu服务器安装FTP服务
参考教程
一、实验环境
- 腾讯云学生机64位ubuntu16.04
- 腾讯云已备案解析域名
- 使用腾讯云webshell登入服务器
二、安装配置FTP
ftp服务器相比seafile网盘就简单很多,主要问题出在配置上
下载ftp
sudo apt-get update
sudo apt-get install vsftpd
安装完成,输入vsftpd -version查看版本,可以的话说明安装成功。
配置环境
打开配置文件vim /etc/vsftpd.conf
将里面的内容覆盖成如下的内容:
listen=NO
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
# 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
# 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 fully customise the login banner string:
ftpd_banner=Welcome to FTP service.
# 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
# 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
pam_service_name=ftp
# 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
#
# Uncomment this to indicate that vsftpd use a utf8 filesystem.
utf8_filesystem=YES
里面有几个重要的参数
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
上面的这几个配置实现的功能是:用户被限制在自己的主目录下。用户名单来源于/etc/vsftpd.chroot_list。
以及
pam_service_name=ftp原配置中为vsftpd,ubuntu用户需要更改成ftp
其他有兴趣的可以去查看其他人的相关教程有介绍
新建用户
sudo useradd -m -s /bin/bash username -g ftp
sudo passwd seafile
然后进入用户,
su username
cd ~
建立ftp访问的文件pub,并给权限
mkdir pub
chmod 777 -R pub
限制用户username只能通过ftp登陆,而不能直接登陆服务器,可以返回ubuntu账户或者root账户操作
sudo usermod -s /sbin/nologin username
新建/etc/vsftpd.chroot_list,并将username加入进去
之后启动或者重启vsftpd即可
/etc/init.d/vsftpd restart
/etc/init.d/vsftpd start
然后在文件管理器那边输入 ftp:www.你的域名,然后输入用户名和密码。
大功告成!
ubuntu服务器安装FTP服务的更多相关文章
- ubuntu 开启 ftp 服务 | mingming-killer
body { font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI ...
- ubuntu 开启ftp服务
一. 检查是否已安装 vsftpd vsftpd -v 二. 安装 vsftpd apt-get install vsftpd 三. 检查是否已安装好 vsftpd vsftpd -v system ...
- ubuntu下ftp服务
(1).首先用命令检查是否安装了vsftpd vsftpd -version 如果未安装用一下命令安装 sudo apt-get install vsftpd 安装完成后,再次输入vsftpd -ve ...
- ubuntu 安装 ftp服务
1. 更新源列表 ---> sudo apt-get update 2. 安装vsftpd ---> sudo apt-get install vsftpd (安装) ----> s ...
- 运维笔记--ubuntu服务器安装telnet服务
ubuntu 16.04 安装Telnet: Telnet协议是TCP/IP协议族中的一员,是Internet远程登陆服务的标准协议和主要方式.可以通过Telnet实现远程登录服务器,同时也可以用“t ...
- ubuntu开启ftp服务
首先再防火墙中开启21和20端口 iptables -A INPUT -p tcp --dport -j ACCEPT iptables -A INPUT -p tcp --dport -j ACCE ...
- 为Ubuntu安装FTP服务
打开"终端窗口",输入"sudo apt-get update"-->回车-->"输入当前登录用户的管理员密码"-->回车 ...
- Ubuntu学习总结-02 Ubuntu下的FTP服务的安装和设置
一 安装vsftpd 在安装前vsftpd,先更新apt-get下载的数据源输入如下命令: sudo apt-get update 然后安装vsftpd sudo apt-get install vs ...
- 关于Ubuntu上的服务文件
问题发现 今天在给ubuntu系统安装ftp服务时,一件奇怪的事引起了我的注意.当我服务安装完成后,想要测试一下是否能控制服务,便输入如下命令: service vsftpd restart 它返回的 ...
随机推荐
- Mergeable Stack 直接list内置函数。(152 - The 18th Zhejiang University Programming Contest Sponsored by TuSimple)
题意:模拟栈,正常pop,push,多一个merge A B 形象地说就是就是将栈B堆到栈A上. 题解:直接用list 的pop_back,push_back,splice 模拟, 坑:用splice ...
- 【make install】自定义安装目录,添加动态链接库 【--prefix】 【ldconfig】 【LD_LIBRARY_PATH】
怎么卸载make install安装的软件? https://www.zhihu.com/question/20092756 怎么指定安装目录以及对应的添加动态库的方法 linux库在不指定安装路径时 ...
- LightOj 1104 - Birthday Paradox(生日悖论概率)
题目链接:http://lightoj.com/volume_showproblem.php?problem=1104 题意:一年365天,在有23个人的情况下,这23个人中有两个人生日相同的概率是大 ...
- Python开发【Tornado】:搭建文件下载服务、音频文件播放
Tornado 如何做文件下载 要求:浏览器输入url地址,直接弹窗提示下载 Tornado服务端,搭建文件下载服务 #!/usr/bin/env python # -*- coding:utf-8 ...
- Python命令行解析库argparse(转)
原文:http://www.cnblogs.com/linxiyue/p/3908623.html 2.7之后python不再对optparse模块进行扩展,python标准库推荐使用argparse ...
- Python学习方法(待补充)
一.好思想总结: 1.一个东西,正在学会了,是需要能简单教会别人,才是真正的理解透彻了,要是讲不透彻,还是一知半解. 2.思路别人教不了你,学会简单处理任何问题,再复杂的东西,在我看来现实项目中,很多 ...
- sql server中的日期详解使用(convert)
转自:http://blog.csdn.net/hehe520347/article/details/48496853 有个字段值例如2012-07-02 00:00:00.000 转化成 2012- ...
- zabbix 报错汇总
打开zabbix web界面点击profile出现以下报错信息: scandir() has been disabled for security reasons [profile.php:198 → ...
- Python3学习之路~2.5 简单的三级菜单程序
程序:三级菜单 需求: 1.打印省.市.县三级菜单2.可返回上一级3.可随时退出程序 代码1: data={ "山东":{ "济南":["历下区&qu ...
- jQuery内部原理和实现方式浅析
这篇文章主要介绍了jQuery内部原理和实现方式浅析,本文试图从整体来阐述一下jQuery的内部实现,需要的朋友可以参考下 这段时间在学习研究jQuery源码,受益于jQuery日益发展强大,研究jQ ...