setup FTP server on CentOS 7
Setup FTP Server on CentOS 7
Install vsftpd
vsftpd (Very Secure File Transport Protocol Daemon) is a secure, fast FTP server for Unix/Linux systems.
# install vsftp
yum install vsftpd -y #edit config file and
## disable anonymous login : change YES to NO
## uncomment ascii_upload_enable=YES and ascii_download_enable=YES
## Uncomment - Enter your Welcome message - This is optional ##
# ftpd_banner=Welcome to UNIXMEN FTP service. vim /etc/vsftpd/vsftpd.conf ## Add at the end of this file ##
use_localtime=YES
#change to NO for listen_ipv6
listen_ipv6=NO
#change to YES for listen
listen=YES
#Following part is very important!!!
pasv_enable=YES
pasv_min_port=5000
pasv_max_port=6000
pasv_address=xxx.xxx.xxx.xxx #public IP goes here
#optionallisten_port=2121
#Enable and start the vsftpd service: systemctl enable vsftpd systemctl start vsftpd
Add new User and set password
By default, root user is not allowed to login to ftp server for security purpose. So, let us create a normal testing user called “sk” with password “centos”.
useradd sk
passwd sk
> ftp 192.168.1.101
Errors and solutions:
1. vsftpd 425 Security: Bad IP connecting
主要是需要在/etc/vsftpd/vsftpd.conf文件中添加如下一行: pasv_promiscuous=YES
然后重启: systemctl restart vsftpd 解决问题
2、ftp中使用get后,文件位于本地哪里: 命令: lcd 或者指定目录 lcd /home/myfolder/testfolder
3、报“use PORT or PASV first.”, 需要使用命令: quote pasv 或者quote port来切换。
4、关于zip/unzip,请访问 http://www.cnblogs.com/swlin/p/PHP.html
Set folder of ftp for user
Simple way:
https://unix.stackexchange.com/questions/94603/limit-ftp-access-only-to-the-var-www-with-vsftpd
Method 1: change user home default directory
Make sure following line exists:
chroot_local_user=YES
Set user HOME Directory to /var/www/ , if you want to change for existing user then you can use:
usermod --home /var/www/ username
then set required permission on /var/www/
Method 2: Use user_sub_tokenIf you don't want to change user's Home directory then you can use:
chroot_local_user=YES
local_root=/ftphome/$USER
user_sub_token=$USER
About user_sub_token
Automatically generate a home directory for each virtual user, based on a template. For example, if the home directory of the real user specified via guest_username is /ftphome/$USER, and user_sub_token is set to $USER, then when virtual user test logs in, he will end up (usually chroot()'ed) in the directory /ftphome/test. This option also takes affect if local_root contains user_sub_token.
Advanced way
http://askubuntu.com/questions/575523/how-to-setup-virtual-users-for-vsftpd-with-access-to-a-specific-sub-directory (TO BE READ)
https://superuser.com/questions/269882/can-i-upload-an-entire-folder-using-ftp (TO BE READ)
How to remove systemd services
My recipe for service obliteration (be careful with the rm statements!)
systemctl stop [servicename]
systemctl disable [servicename]
rm /etc/systemd/system/[servicename]
rm /etc/systemd/system/[servicename] symlinks that might be related
systemctl daemon-reload
systemctl reset-failed
Reference
https://www.unixmen.com/install-configure-ftp-server-centos-7/
http://www.cnblogs.com/hhuai/archive/2011/02/12/1952647.html
FTP Commands:https://www.cs.colostate.edu/helpdocs/ftp.html
FTP Config: http://vsftpd.beasts.org/vsftpd_conf.html
setup FTP server on CentOS 7的更多相关文章
- Setup FTP Server On CentOS, RHEL, Scientific Linux 6.5/6.4/6.3
setsebool allow_ftpd_full_access onsetsebool -P ftp_home_dir on vsftpd (Very Secure File Transport P ...
- Setup FTP server on Ubuntu 14.04
Setup FTP server on Ubuntu 14.04 Step 1 » Update repositories .krizna@leela:~$ sudo apt-get updateSt ...
- Setup Git Server in CentOS 6.3
0. Environment: Server machine: CentOS 6.3 x86 Client machine: Windows 10 Pro x86_64 1. Install ssh ...
- Ubuntu setup ftp server.
http://www.cnblogs.com/bcsflilong/p/4200139.html Steps 1. Install vsftpd sudo apt-get install vsftpd ...
- Setup VSFTPD Server with Virtual Users On CentOS, RHEL, Scientific Linux 6.5/6.4/6.3
We have already shown you How to Setup VSFTPD Server on CentOS 6.5/6.4 in our previous article. In t ...
- centos 安装FTP server详情(转)
centos 安装FTP server详情 分类: linux 2013-12-27 16:45 227人阅读 评论(0) 收藏 举报 我们这里以安装vsftpd 服务器端为例子: 1.进入到cent ...
- Centos下ftp协议连接远程ftp server主机
环境说明 [root@Check3 ~]# cat /etc/redhat-release CentOS release 6.9 (Final) [root@Check3 ~]# uname -a L ...
- Setup and Configure the vsftpd server in CentOS 7 operation system
############################################################################## 1. close the firewall ...
- How to set up an FTP server on Ubuntu 14.04
How to set up an FTP server on Ubuntu 14.04 Setting up a fully-functional and highly secure FTP serv ...
随机推荐
- Taro覆盖iview样式
/* CustomComp.js */ export default CustomComp extends Component { static options = { addGlobalClass: ...
- python输入
(程序是如何输入输出的) 先了解一个概念,什么是函数? 简单来说,函数就是封装了一些功能,到时候只需要写一个函数名字,就可以使用这些功能 input函数,它是输入函数,它可以将用户输入的内容当做“字符 ...
- Imcash科普:没有网络也可以转账比特币?你可能有些误解
近日,据Bitcoinist消息,比特币解决方案开发商CoinKite联合创始人Rodolfo Novak和OpenBazaar联合创始人Sam Patterson在推特上宣布,两人不借助互联网和卫星 ...
- Django学习笔记二
Django学习笔记二 模型类,字段,选项,查询,关联,聚合函数,管理器, 一 字段属性和选项 1.1 模型类属性命名限制 1)不能是python的保留关键字. 2)不允许使用连续的下划线,这是由dj ...
- python 爬虫与数据可视化--数据提取与存储
一.爬虫的定义.爬虫的分类(通用爬虫.聚焦爬虫).爬虫应用场景.爬虫工作原理(最后会发一个完整爬虫代码) 二.http.https的介绍.url的形式.请求方法.响应状态码 url的形式: 请求头: ...
- BZOJ.2780.[SPOJ8093]Sevenk Love Oimaster(广义后缀自动机)
题目链接 \(Description\) 给定n个模式串,多次询问一个串在多少个模式串中出现过.(字符集为26个小写字母) \(Solution\) 对每个询问串进行匹配最终会达到一个节点,我们需要得 ...
- JavaScript的正则表达式的基础
正则表达式:* 具体字符(字面值)*字符边界*字符集合[ace],[0123456789]*字符补集[^ qxz]: 不在qxz范围内*字符范围[a-z 0-9]*字符簇(系统定义好的常用集合)--- ...
- [LeetCode] Card Flipping Game 翻卡片游戏
On a table are N cards, with a positive integer printed on the front and back of each card (possibly ...
- 隐藏状态栏,toolbar前面空格问题,editText圆角
EditText圆角: 一.在drawable下面添加xml文件rounded_editview.xml 复制代码 代码如下: <?xml version="1.0" enc ...
- xampp+discuz 安装踩坑后总结
之前安装xampp先是出现mysql无法启动,接着安装discuz到最后一部时出现乱码,以及报错(0).后来卸载了xampp,重新安装xampp和discuz后就可以了,应该是版本太高的问题, xam ...