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 ...
随机推荐
- Swift - use Array
//数组声明 var arr0 = Array<Int>() var arr1 = Array<String>(count: 3, repeatedValue: "& ...
- c_数据结构_队的实现
# 链式存储#include<stdio.h> #include<stdlib.h> #define STACK_INIT_SIZE 100//存储空间初始分配量 #defin ...
- Linux系统挂载Windows系统下的共享文件
声明:本文是小编借鉴大神们的经验,仅供学习使用. 第一步:在Windows系统上选择要共享的文件夹,右击“属性”-“共享”-“高级共享”-勾选“共享此文件”-设置共享名-“权限”-“添加”-“高级”- ...
- 业务线--node中间层做一个透传的项目
1,node中间层总结 1,ejs引入vue的js,路由层(直接透传,自定义行的),比较浅层的一层 中间件的引入 ? ) { // 与rd约定,接口成功返回code===0,其余为失败 console ...
- maven deploy Return code is: 400, ReasonPhrase: Bad Request.
最近在自己本地deploy jar 到本地 nexus的时候,报错 Return code is: 400, ReasonPhrase: Bad Request. 解决思路: 1.查看maven pr ...
- 关于finally代码块是否一定被执行的问题
一般来说,只要执行了try语句,finally就会执行 但是,有以下几种情况需要特殊考虑 具体例子看链接 点击这里 第一点 try代码块没有被执行,意思就是错误在try代码块之前就发生了. 第二点 ...
- wamp 环境安装php_mongo 或 mongodb的扩展
特别注意:momgo 与mondb 是两个不同的扩展,不是同一个,这是一个坑 1.查看你的php版本,Compiler,Thread safety版本 2.下载地址 https://pecl.php. ...
- Red hat查找命令所属的rpm包
当安装命令软件包时,很多时候命令名不一定就是软件包的名字 如scp命令,其命令名就和软件包名字不一样,直接安装会失败: #yum install scp .... Trying other mirro ...
- DAG---矩阵嵌套问题
矩形嵌套时间限制:3000 ms | 内存限制:65535 KB 难度:4 描述 有n个矩形,每个矩形可以用a,b来描述,表示长和宽.矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a<c, ...
- 取消Fragment切换时间,Fragment+ViewPager静止滑动,去掉默认的滑动效果
import android.content.Context; import android.support.v4.view.ViewPager; import android.util.Attrib ...