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 ...
随机推荐
- C#实现短链接生成服务
项目中有一处需求,需要把长网址缩为短网址,把结果通过短信.微信等渠道推送给客户.刚开始直接使用网上现成的开放服务,然后在某个周末突然手痒想自己动手实现一个别具特色的长网址(文本)缩短服务. 由于以前做 ...
- 毕向东—Java基础知识总结(超级经典)
Java基础知识总结(超级经典) 写代码: 1,明确需求.我要做什么? 2,分析思路.我要怎么做?1,2,3. 3,确定步骤.每一个思路部分用到哪些语句,方法,和对象. 4,代码实现.用具体的java ...
- Innodb与Myisam引擎的区别与应用场景
1. 区别: (1)事务处理: MyISAM是非事务安全型的,而InnoDB是事务安全型的(支持事务处理等高级处理): (2)锁机制不同: MyISAM是表级锁,而InnoDB是行级锁: (3)sel ...
- 使用ansible kubectl插件连接kubernetes pod以及实现原理
ansible kubectl connection plugin ansible是目前业界非常火热的自动化运维工具.ansible可以通过ssh连接到目标机器上,从而完成指定的命令或者操作. 在ku ...
- 关于linux上部署定时python脚本
遇到的坑: Python脚本中的文件操作,最好都用绝对路径, 文件头上写 #!/usr/local/bin/python3.6 ----------------------------------- ...
- Java虚拟机-对象的创建和访问
一.对象的创建: 创建对象在java上面是很简单的,使用new关键字就可以了,但是其实在虚拟机中,java对象的创建是一个复杂的过程. 当java虚拟机遇到一个new的指令的时候,对象创建的程序正式启 ...
- vee-validate的使用
官网地址:http://vee-validate.logaretm.com/ 这是一个插件Vue.js可以验证输入字段,显示错误,在一个简单而强大的方法.学习vee-validate,首先可以去阅读官 ...
- python3 load Iris.data数据集出现报错key words: b'Iris-setosa'
通过搜索原因,发现有可能是在对文件读取是编译出现了问题,并且Keyword中提示b'Iris-setosa',而我们的string转float函数中没有字母b,很奇怪.所以尝试将转换函数所有的stri ...
- python全栈开发 * background 定位 z-index * 180813
I back-ground 一.颜色的表示: 1.单词 2.rgb表示法 rgb:红色 绿色 蓝色 三原色 光学显示器每个像素都是由三原色的发光原件组成的,靠明亮度不同调成不同的颜色的. 用逗号隔开, ...
- springmvc+hibernate
<本文摘要他人> 1.设计数据库:设计好表结构,最好符合3NF,采用Hibernate tools将设计好的表自动生成对应的实体entity. 1.创建Maven项目,按需映入Maven包 ...