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 ...
随机推荐
- python的单、双、多分支流程控制
if流程控制总结: 1.当满足条件时,执行满足条件的代码. 2.当执行完if语句内代码,程序继续往下执行. 单分支: if 条件成立,执行满足条件的代码 如下: if a>50: print(' ...
- vuejs使用jsx语法
想要vuejs项目支持jsx语法,需要一些插件 babel-plugin-transform-vue-jsx Babel plugin for Vue 2.0 JSX 使用方法: 安装 npm ins ...
- mysql字段有中英文,数字按照升序/降序 排序
ORDER BY CONVERT(name,SIGNED) ASC, CONVERT(name USING gbk) DESC
- 不装插件,查看.rp文件
AxShare国内平台地址:http://share.axure.org临时急用可以使用公用帐户.用户名:axure@webppd.com,密码:webppd123 上传.rp文件,点击 url 地址 ...
- openKM部署二次开发,eclipse环境
1.下载openKM_install_forwin安装包,配置jdk环境,start openKM,访问localhost\OpenKM,用户:okmAdmin 密码:admin.查看是否启动成功.安 ...
- 【国庆】记一次mysqld_safe引发mysql进程故障
今天是举国欢庆的日子,但是Mariadb密码忘记了,于是巴拉巴拉的执行"mysqld_safe --skip-grant-tables &"这个神技能,打算跳过密码验证,直 ...
- 消息队列——ActiceMQ
1.下载apache-activemq-5.xx.x,\bin\win64目录下运行activemq.bat.之后可进入管理员界面http://localhost:8161/admin,账号密码均为a ...
- XVIII Open Cup named after E.V. Pankratiev. Eastern Grand Prix
A. Artifacts 建立语法分析树,首先根据上下界判断是否有解,然后将所有数按下界填充,线段树判断是否存在和超过$K$的子区间. B. Brackets and Dots 最优解中一定包含一对中 ...
- (84)Wangdao.com第十八天_JavaScript Promise 对象
Promise 对象 是 JavaScript 的异步操作解决方案,为异步操作提供统一接口. 目前 JavaScript 原生支持 Promise 对象 它起到代理作用(proxy),充当异步操作与回 ...
- get与post请求问题
req.url可以获取请求路径: 为避免浏览器自身发送的'/favicon.ico'的影响,获取路径后可利用if(req.url=='/favicon.ico') return ;处理 url.pa ...