国产银河麒麟服务器vsftp匿名用户本地用户的一般设置

使用银河麒麟V10-sp1服务器来搭建FTP服务器。

安装vsftp

yum install vsftpd(装机镜像有包)
安装ftp客户端(可选,互联网源有)
yum install ftp
启动 systemctl start vsftpd
关闭防火墙
配置文件/etc/vsftpd/vsftpd.conf

1、匿名用户模式

客户端使用ftp用户登录,不需要密码。
文件需要有o+r权限,客户端才能下载
客户端上传文件。创建一个文件夹加上o+w权限设置 write_enable=YES

anonymous_enable=YES #允许匿名用户登录FTP
anon_root=/var/ftp/pub #设置匿名用户的登录目录默认是这个目录
anon_upload_enable=YES #打开匿名用户的上传权限
anon_mkdir_write_enable=YES #打开匿名用户创建目录的权限
anon_other_write_enable=YES#打开匿名用户删除和重命名的权限
anon_umask=022 #匿名用户的掩码 

2、本地用户

local_root=/var/ftp #修改本地用户的默认ftp目录,默认是用户家目录
默认本地用户可以通过ftp登录到服务器,进行系统目录切换。可通过如下方法禁止登录ftp用户切换系统目录

chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list #可以进行系统目录访问的用户列表
allow_writeable_chroot=YES
##创建chroot_list名单,开放只要把用户名写入文件即可,一行一个用户
touch /etc/vsftpd/chroot_list

----用户权限实现多用户管理ftp,如上传和下载权限分开
添加user_config_dir=/etc/vsftpd/user_conf
mkdir /etc/vsftpd/user_conf
给用户添加权限,如使某个用户不能删除文件,在/etc/vsftpd/user_conf目录下建配置文件,用用户命名。
如 vim /etc/vsftpd/user_conf/wu
添加cmds_denied=DELE,RMD,实现不能删除的文件或者文件夹的功能
多用户会有目录权限的问题,可以设置local_umask=000解决
以下一些常用控制。
local_root= 可以更改用户的ftp目录
local_max_rate= 限制此用户带宽.
cmds_denied= 此用户不可以使用的指令,多个用逗号隔开
cmds_allowed= 此用户可以使用的指令
具体操作参见如下

# ABOR - abort a file transfer
# CWD - change working directory
# DELE - delete a remote file
# LIST - list remote files
# MDTM - return the modification time of a file
# MKD - make a remote directory
# NLST - name list of remote directory
# PASS - send password
# PASV - enter passive mode
# PORT - open a data port
# PWD - print working directory
# QUIT - terminate the connection
# RETR - retrieve a remote file
# RMD - remove a remote directory
# RNFR - rename from
# RNTO - rename to
# SITE - site-specific commands
# SIZE - return the size of a file
# STOR - store a file on the remote host
# TYPE - set transfer type
# USER - send username
# less common commands:
# ACCT* - send account information
# APPE - append to a remote file
# CDUP - CWD to the parent of the current directory
# HELP - return help on using the server
# MODE - set transfer mode
# NOOP - do nothing
# REIN* - reinitialize the connection
# STAT - return server status
# STOU - store a file uniquely
# STRU - set file transfer structure
# SYST - return system type

3、虚拟用户

。。。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值