Linux 搭建 ftp 环境
来源:互联网 发布:日系化妆品 知乎 编辑:程序博客网 时间:2024/05/17 15:03
FTP服务器搭建chown | chmod chown = change ownerchmod = change mode [w4 r2 x1]chown [选项]... [所有者][:[组]] 文件... 通过chown改变文件的拥有者和群组-R 处理指定目录以及其子目录下的所有文件改变指定目录以及其子目录下的所有文件的拥有者和群组 chown -R -v root:mail test6[chown 用户名:组名 文件路径[可以是就对路径也可以是相对路径]]检测出是否安装了vsftpd软件,rpm -qa |grep vsftpd使用vsftpd软件,主要包括如下几个命令: 启动ftp:service vsftpd start 停止ftp:service vsftpd stop 重启ftp:service vsftpd restart 1.创建ftp上传根目录[root@CS4 huagong]# mkdir -p /opt/huagong/data/media3.配置FTP服务器禁止匿名上传,修改配置文件,以及设置相关信息[root@CS4 huagong]# vi /etc/vsftpd/vsftpd.conf 在末尾增加如下几项配置表明FTP设置根目录 seccomp_sandbox=NO local_root=/opt/huagong/data anon_root=/opt/huagong/data chroot_local_user=YES allow_writeable_chroot=YES本配置开通了匿名访问、匿名上传和下载等功能 修改上传目录属性1)创建ftp用户ftpuser,并设置其密码为ftpuser [root@CS4 huagong]# groupadd ftp2)往ftp用户组中添加新用户: ftpuser [root@CS4 huagong]# useradd -G ftp -d /opt/huagong/data/media -M ftpuser [root@CS4 huagong]# passwd ftpuser3)改变文件夹的属主和权限 [root@CS4 huagong]# chown -R ftpuser:ftpuser /opt/huagong/data/media[root@CS4 huagong]# chown -R ftpuser:ftpuser /opt/huagong/data4)改变父文件夹权限 [root@CS4 huagong]# chmod 755 /opt/huagong[root@CS4 huagong]# chmod -R 766 /opt/huagong/data改变目录权限 [root@CS4 huagong]# chmod -R 766 /opt/huagong/data/media5.启动ftp服务 [root@CS4 huagong]# service vsftpd start [root@CS4 huagong]# service vsftpd status [root@CS4 huagong]# chkconfig --list //默认开机启动列表查询 [root@CS4 huagong]# chkconfig --level 2345 vsftpd on //设置默认开机启动6.测试FTP服务器 ftp://IP/ 用户名:ftpuser 密码:ftpuser
# Example config file /etc/vsftpd/vsftpd.conf## The default compiled in settings are fairly paranoid. This sample file# loosens things up a bit, to make the ftp daemon more usable.# Please see vsftpd.conf.5 for all compiled in defaults.## READ THIS: This example file is NOT an exhaustive list of vsftpd options.# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's# capabilities.## Allow anonymous FTP? (Beware - allowed by default if you comment this out).anonymous_enable=NO## Uncomment this to allow local users to log in.# When SELinux is enforcing check for SE bool ftp_home_dirlocal_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## Uncomment this to allow the anonymous FTP user to upload files. This only# has an effect if the above global write enable is activated. Also, you will# obviously need to create a directory writable by the FTP user.# When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access#anon_upload_enable=YES## Uncomment this if you want the anonymous FTP user to be able to create# new directories.anon_mkdir_write_enable=YES## Activate directory messages - messages given to remote users when they# go into a certain directory.dirmessage_enable=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## If you want, you can arrange for uploaded anonymous files to be owned by# a different user. Note! Using "root" for uploaded files is not# recommended!#chown_uploads=YES#chown_username=whoever## You may override where the log file goes if you like. The default is shown# below.#xferlog_file=/var/log/xferlog## 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 change the default value for timing out an idle session.#idle_session_timeout=600## You may change the default value for timing out a data connection.#data_connection_timeout=120## It is recommended that you define on your system a unique user which the# ftp server can use as a totally isolated and unprivileged user.#nopriv_user=ftpsecure## Enable this and the server will recognise asynchronous ABOR requests. Not# recommended for security (the code is non-trivial). Not enabling it,# however, may confuse older FTP clients.#async_abor_enable=YES## By default the server will pretend to allow ASCII mode but in fact ignore# the request. Turn on the below options to have the server actually do ASCII# mangling on files when in ASCII mode.# Beware that on some FTP servers, ASCII support allows a denial of service# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd# predicted this attack and has always been safe, reporting the size of the# raw file.# ASCII mangling is a horrible feature of the protocol.#ascii_upload_enable=YES#ascii_download_enable=YES## You may fully customise the login banner string:#ftpd_banner=Welcome to blah FTP service.## You may specify a file of disallowed anonymous e-mail addresses. Apparently# useful for combatting certain DoS attacks.#deny_email_enable=YES# (default follows)#banned_email_file=/etc/vsftpd/banned_emails## 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## You may activate the "-R" option to the builtin ls. This is disabled by# default to avoid remote users being able to cause excessive I/O on large# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume# the presence of the "-R" option, so there is a strong case for enabling it.#ls_recurse_enable=YES## When "listen" directive is enabled, vsftpd runs in standalone mode and# listens on IPv4 sockets. This directive cannot be used in conjunction# with the listen_ipv6 directive.listen=NO## This directive enables listening on IPv6 sockets. By default, listening# on the IPv6 "any" address (::) will accept connections from both IPv6# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6# sockets. If you want that (perhaps because you want to listen on specific# addresses) then you must run two copies of vsftpd with two configuration# files.# Make sure, that one of the listen options is commented !!listen_ipv6=YESpam_service_name=vsftpduserlist_enable=YEStcp_wrappers=YESseccomp_sandbox=NOlocal_root=/opt/keji/dataanon_root=/opt/keji/datachroot_local_user=YESallow_writeable_chroot=YES
阅读全文
0 0
- linux FTP环境搭建
- Linux 搭建 ftp 环境
- LAMP环境搭建 Linux/SSH/FTP server
- Linux环境下搭建ftp服务器
- centos搭建ftp环境
- ubuntu14 搭建FTP环境
- FTP环境搭建
- linux环境搭建ftp服务以及遇到的问题总结:上传不成功,ftp:connection refused等等
- Redhat linux搭建ftp
- linux ftp搭建
- linux ftp 服务器搭建
- linux 下搭建 ftp
- Linux搭建FTP服务
- linux 搭建 ftp 服务器
- linux下搭建ftp
- linux搭建ftp
- Linux 下FTP搭建
- linux下搭建FTP
- Ubuntu更新源
- Mysql分别在windows和linux下导入导出sql文件
- No outbound converter found for XXX
- python 部署pythonweb开发的几种方式
- 语音测试基础以及demo解读
- Linux 搭建 ftp 环境
- YTU.3155: 贪心之Packets
- Git常用命令
- 记录一下怎么使用pycaffe调用已有的网络模型识别人脸(物体)
- intelliJ IDEA 2017.1.3 创建maven web项目
- CSDN Markdown 博客范文代码
- 深度学习高手该怎样炼成?这位拿下阿里天池大赛冠军的中科院博士为你规划了一份专业成长路径
- AR# 54242: Install
- 重磅 阿里云成为CNCF白金会员