在redhat linux下配置vsftpd服务器

Ø anonymous_enable=YES ( 是否允许 匿名登录FTP 服务器,默认设置为YES 允许,即用户可使用用户名ftp 或anonymous 进行ftp登录,口令为用户的E-mail 地址。如不允许匿名访问去掉前面#并设置为NO )

Ø #Uncomment this to allow local users to log in.

Ø local_enable=YES (是否允许本地用户 ( 即 linux 系统中的用户帐号) 登录FTP服务器,默认设置为YES允许, 本地用户登录后会进入用户主目录,而匿名用户登录后进入匿名用户的下载目录/var/ftp/pub ;若只允许匿名用户访问,前面加上#,可 阻止本地用户访问FTP 服务器。)

Ø #Uncomment this to enable any form of FTP write command.

Ø write_enable=YES  ( 是否允许本地用户对 FTP 服务器文件具有写权限 , 默认设置为 YES 允许 )

Ø #Default umask for local users is 077. You may wish to change this to 022,

Ø # ifyour users expect that (022 is used by most other ftpd’s)

Ø # local_umask=022 (或其它值,设置本地用户的文件掩码 为缺省022,也可根据个人喜好将其设置为其他值,默认值为077)

Ø #Uncomment this to allow the anonymous FTP user to upload files. This only

Ø # hasan effect if the above global write enable is activated. Also, you will

Ø #obviously need to create a directory writable by the FTP user.

Ø #anon_upload_enable=YES ( 是否允许匿名用户上传文件 , 须将 write_enable=YES , 默认设置为 YES 允许 )

Ø #Uncomment this if you want the anonymous FTP user to be able to create

Ø # newdirectories.

Ø #anon_mkdir_write_enable=YES   ( 是否允许匿名用户创建新文件夹 , 默认设置为 YES 允许 )

Ø #Activate directory messages - messages given to remote users when they

Ø # gointo a certain directory.

Ø #dirmessage_enable=YES ( 是否激活目录欢迎信息功能 , 当用户用 CMD模式首次访问服务器上某个目录时 ,FTP 服务器将显示欢迎信息 , 默认情况下 , 欢迎信息是通过 该 目录下的 .message 文件获得的,此文件保存自定义的欢迎信息,由用户自己建立)

Ø #Activate logging of uploads/downloads.

Ø xferlog_enable=YES ( 默认值为 NO 如果启用此选项,系统将会维护记录服务器上传和下载情况的日志文件,默认情况该日志文件为/var/log/vsftpd.log, 也可以通过下面的 xferlog_file 选项对其进行设定。)

Ø # Makesure PORT transfer connections originate from port 20 (ftp-data).

Ø connect_from_port_20=YES ( 设定 FTP 服务器将启用 FTP 数据端口的连接请求 ,ftp-data 数据传输 ,21 为连接控制端口 )

Ø # Ifyou want, you can arrange for uploaded anonymous files to be owned by

Ø # adifferent user. Note! Using “root” for uploaded files is not

Ø #recommended!-注意,不推荐使用 root 用户上传文件

Ø #chown_uploads=YES ( 设定是否允许 改变 上传文件的属主 , 与下面一个设定项配合使用 )

Ø #chown_username=whoeve r ( 设置想要改变的上传文件的属主 , 如果需要 , 则输入一个系统用户名 , 例如可以把上传的文件都改成 root 属主。whoever :任何人)

Ø # Youmay override where the log file goes if you like. The default is shown

Ø #below.

Ø #xferlog_file=/var/log/vsftpd.log ( 设定系统维护记录FTP 服务器上传和下载情况的日志文件,/var/log/vsftpd.log 是默认的,也可以另设其它)

Ø # Ifyou want, you can have your log file in standard ftpd xferlog format

Ø #xferlog_std_format=YES ( 如果启用此选项 , 传输日志文件将以标准 xferlog 的格式书写,该格式的日志文件默认为/var/log/xferlog,也可以通过xferlog_file 选项对其进行设定,默认值为NO)

Ø #dual_log_enable ( 如果添加并启用此选项,将生成两个相似的日志文件,默认在/var/log/xferlog和/var/log/vsftpd.log 目录下。前者是wu_ftpd类型的传输日志,可以利用标准日志工具对其进行分析;后者是vsftpd 类型的日志)

Ø #syslog_enable ( 如果添加并启用此选项,则原本应该输出到/var/log/vsftpd.log 中的日志,将输出到系统日志中)

Ø # Youmay change the default value for timing out an idle session.

Ø #idle_session_timeout=600 (设置数据传输中断间隔时间,此语句表示空闲的用户会话中断时间为600秒,即当数据传输结束后,用户连接FTP服务器的时间不应超过600秒,可以根据实际情况对该值进行修改)

Ø # Youmay change the default value for timing out a data connection.

Ø #data_connection_timeout=120 ( 设置数据连接超时时间 , 该语句表示数据连接超时时间为 120 秒 , 可根据实际情况对其个修改 )

Ø # Itis recommended that you define on your system a unique user which the

Ø # ftpserver can use as a totally isolated and unprivileged user.

Ø #nopriv_user=ftpsecure ( 运行 vsftpd 需要的非特权系统用户,缺省是nobody )

Ø #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 ( 如果 FTPclient 会下达“async ABOR ”这个指令时,这个设定才需要启用,而一般此设定并不安全,所以通常将其取消)

Ø # Bydefault the server will pretend to allow ASCII mode but in fact ignore

Ø # therequest. 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

Ø # rawfile.

Ø #ASCII mangling is a horrible feature of the protocol.

Ø #ascii_upload_enable=YES ( 大多数 FTP 服务器都选择用 ASCII 方式传输数据 , 将 # 去掉就能实现用 ASCII 方式上传和下载文件 )

Ø #ascii_download_enable=YES ( 将 # 去掉就能实现用 ASCII 方式下载文件 )

Ø # Youmay fully customise the login banner string:

Ø #ftpd_banner=Welcome to blah FTP service. (将#去掉可设置登录FTP服务器时显示的欢迎信息,可以修改=后的欢迎信息内容。另外如在需要设置更改目录欢迎信息的目录下创建名为 .message 的文件,并写入欢迎信息保存后,在进入到此目录会显示自定义欢迎信息 )

Ø # Youmay specify a file of disallowed anonymous e-mail addresses. Apparently

Ø #useful for combatting certain DoS attacks.

Ø #deny_email_enable=YES ( 可将某些特殊的 email address 抵挡住。如果以anonymous 登录服务器时,会要求输入密码,也就是您的email address, 如果很讨厌某些email address ,就可以使用此设定来取消他的登录权限,但必须与下面的设置项配合 )

Ø #(default follows)

Ø #banned_email_file=/etc/vsftpd/banned_emails (当上面的 deny_email_enable=YES 时,可以利用这个设定项来规定那个email address 不可登录vsftpd 服务器,此文件需用户自己创建,一行一个email address 即可! )

Ø # Youmay 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().

Ø #chroot_list_enable=YES ( 设置为 NO 时,用户登录FTP 服务器后具有访问自己目录以外的其他文件的权限, 设置为 YES 时 , 用户被锁定在自己的 home 目录中,vsftpd 将在下面 chroot_list_file 选项值的位置寻找 chroot_list 文件,此文件需用户建立, 再将需锁定在自己home 目录的用户列入其中,每行一个用户)

Ø #(default follows)

Ø #chroot_list_file=/etc/vsftpd/chroot_list ( 此文件需自己建立 , 被列入此文件的用户 , 在登录后将不能切换到自己目录以外的其他目录 , 由 FTP 服务器自动地 chrooted 到用户自己的home 目录下,使得 chroot_list 文件中的用户不能随意转到其他用户的FTP home 目录下,从而有利于FTP 服务器的安全管理和隐私保护)

Ø # Youmay 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

Ø # thepresence of the “-R” option, so there is a strong case for enablingit.

Ø #ls_recurse_enable=YES ( 是否允许递归查询 , 大型站点的 FTP 服务器启用此项可以方便远程用户查询

Ø # When"listen" directive is enabled, vsftpd runs in standalone mode and

Ø #listens on IPv4 sockets. This directive cannot be used in conjunction

Ø # withthe listen_ipv6 directive.

Ø listen=YES ( 如果设置为 YES , 则 vsftpd 将以独立模式运行,由vsftpd 自己监听和处理连接请求)

Ø # Thisdirective enables listening on IPv6 sockets. To listen on IPv4 and IPv6

Ø #sockets, you must run two copies of vsftpd whith two configuration files.

Ø # Makesure, that one of the listen options is commented !!

Ø #listen_ipv6=YES ( 设定是否支持IPV6)

Ø #pam_service_name=vsftpd ( 设置 PAM 外挂模块提供的认证服务所使用的配置文件名 ,即/etc/pam.d/vsftpd 文件,此文件中file=/etc/vsftpd/ftpusers字段,说明了PAM 模块能抵挡的帐号内容来自文件/etc/vsftpd/ftpusers中)

Ø #userlist_enable=YES/NO (此选项默认值为NO , 此时ftpusers 文件中的用户禁止登录FTP 服务器;若此项设为YES ,则 user_list 文件中的用户允许登录 FTP 服务器,而如果同时设置了 userlist_deny=YES ,则 user_list 文件中的用户将不允许登录FTP 服务器,甚至连输入密码提示信息都没有,直接被FTP 服务器拒绝)

Ø #userlist_deny=YES/NO (此项默认为YES ,设置是否阻扯user_list 文件中的用户登录FTP 服务器)

Ø tcp_wrappers=YES ( 表明服务器使用 tcp_wrappers 作为主机访问控制方式,tcp_wrappers 可以实现linux 系统中网络服务的基于主机地址的访问控制,在/etc 目录中的hosts.allow 和hosts.deny 两个文件用于设置tcp_wrappers 的访问控制,前者设置允许访问记录,后者设置拒绝访问记录。例如想限制某些主机对FTP 服务器192.168.57.2 的匿名访问,编缉**/etc/hosts.allow** 文件,如在下面增加两行命令:vsftpd:192.168.57.1:DENYvsftpd:192.168.57.9:DENY 表明限制IP 为192.168.57.1/192.168.57.9 主机访问IP 为192.168.57.2 的FTP服务器,此时FTP 服务器虽可以PING 通,但无法连接)

12、             匿名:anonymous,密码是没有的

13、             Vsftp根目录 /var/ftp/

a)        向下面的pub里面下载文件就可以了

b)        如果要上传,默认不允许,匿名anonymous上传。

14、             很多ftp用户管理跟linux用户管理放在一起的

15、             允许root用户上传(一般不用)

16、             允许root上传

a)        只需要更改两个配置文件文件;(/etc/vsftpd)

b)        改配置文件vsftpd.user_list(把root用户删除或者用#注释,#root)

c)        改配置文件vsftpd.user_ftpusers(把root用户删除或者用#注释,#root)

d)        再重新启动vsftp  service vsftpd restart

在这种情况下用root登录上去,默认登录根目录

17、             默认启动设置:

a)        方法一:chkconfig vsftpdon或chkconfig –level 5 vsftpd on

b)        只要在第2–5为on就能随机在哪个级别上启动,

c)        查看启动方式:chkconfig–list |grep vsftpd

d)        方法二:用vi打开:/etc/rc.local在里面加入/user/local/bin/vsftpd即可

18、             在配置vsftpd过程中linux的selinux默认下是启动的,有时候这个东西有加强安全性的同时很讨厌,比如让配置好的vsftpd无法正常登录,也无法上传。此时可以采用两种办法。

i.             一种办法:

#setsebool -P ftpd_disable_trans 1

然后重启vsftpd服务。

ii.             另一种办法,直接关掉selinux

vim /etc/sysconfig/selinux

selinux=disable

然后重启即可。

19、             或者先查看selinux的状态: getsebool –a或sestatus -v
**a)        使用setsebool命令开启对应属性:**setsebool ftpd_disable_trans on
b)        setsebool使用-P参数,无需每次开机都输入这个命令: setsebool -Pftpd_disable_trans on
c)         **获取本机selinux策略值,也称为bool值。:**getsebool -a  命令或sestatus -b

最后总结

ActiveMQ+Kafka+RabbitMQ学习笔记PDF

image.png

  • RabbitMQ实战指南

image.png

  • 手写RocketMQ笔记

image.png

  • 手写“Kafka笔记”

image

关于分布式,限流+缓存+缓存,这三大技术(包含:ZooKeeper+Nginx+MongoDB+memcached+Redis+ActiveMQ+Kafka+RabbitMQ)等等。这些相关的面试也好,还有手写以及学习的笔记PDF,都是啃透分布式技术必不可少的宝藏。以上的每一个专题每一个小分类都有相关的介绍,并且小编也已经将其整理成PDF啦

最后总结

ActiveMQ+Kafka+RabbitMQ学习笔记PDF

[外链图片转存中…(img-nAcHwdGO-1721176607098)]

  • RabbitMQ实战指南

[外链图片转存中…(img-Q515qqMp-1721176607099)]

  • 手写RocketMQ笔记

[外链图片转存中…(img-djJlMKyU-1721176607099)]

  • 手写“Kafka笔记”

[外链图片转存中…(img-nEwlpAce-1721176607100)]

关于分布式,限流+缓存+缓存,这三大技术(包含:ZooKeeper+Nginx+MongoDB+memcached+Redis+ActiveMQ+Kafka+RabbitMQ)等等。这些相关的面试也好,还有手写以及学习的笔记PDF,都是啃透分布式技术必不可少的宝藏。以上的每一个专题每一个小分类都有相关的介绍,并且小编也已经将其整理成PDF啦

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值