CentOS 7安装FTP服务器

Author:想吃肉蟹煲呀
date:2021-11-18

安装vsftpd

yum install -y vsftpd

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-b77C3hwX-1665749663533)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211201105736528.png)]

启动服务并且将服务设置成开机自启

systemctl start vsftpd
systemctl enable vsftpd

配置vsftpd

  • 添加用户并设置访问的ftp目录

    useradd ftpuser -s /sbin/nologin -d /ftp_data && echo "123456"|passwd ftpuser --stdin 
    

其中新增的用户名为ftpuser,密码为123456,vsftpd的数据目录为/ftp_data

  • 将/ftp_data的所有者修改为ftpuser

    chown ftpuser:ftpuser /ftp_data/
    
  • 备份vsftpd的配置文件

    cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak
    
  • 修改vsftpd.conf配置文件,禁用匿名用户访问ftp服务器

    vim /etc/vsftpd/vsftpd.conf
    

    将配置文件中的anonymous_enable=YES修改成anonymous_enable=NO

  • 修改配置文件/etc/pam.d/vsftpd

    #备份配置文件
    cp /etc/pam.d/vsftpd /etc/pam.d/vsftpd.bak
    #编辑配置文件
    vim /etc/pam.d/vsftpd
    #将auth required pam_shells.so修改为->auth required pam_nologin.so
    

    参考文章:(10条消息) centos7下配置ftp服务器,各种登录异常排查_andy_521521的博客-CSDN博客

  • 重启ftp服务

    systemctl restart vsftpd.service
    
  • 查看并修改selinux中有关ftp的配置

    getsebool -a | grep ftp
    

    如下显示:

    ftpd_anon_write --> off
    ftpd_connect_all_unreserved --> off
    ftpd_connect_db --> off
    ftpd_full_access --> off
    ftpd_use_cifs --> off
    ftpd_use_fusefs --> off
    ftpd_use_nfs --> off
    ftpd_use_passive_mode --> off
    httpd_can_connect_ftp --> off
    httpd_enable_ftp_server --> off
    tftp_anon_write --> off
    tftp_home_dir --> off
    
    #修改配置
    setsebool -P ftpd_full_access on
    setsebool -P tftp_home_dir on #测试时只配置上面`ftpd_full_access`不用配置`tftp_home_dir`也行
    

    -P参数为永久开启,CentOS 7开始使用tftp_home_dir代替ftp_home_dir

    参考文章:【Linux/CentOS】Boolean ftp_home_dir is not defined - 霍莉雪特 - 博客园 (cnblogs.com)

  • 配置防火墙

    firewall-cmd --permanent --zone=public --add-service=ftp
    或
    firewall-cmd --zone=public --add-port=21/tcp --permanent
    #重置防火墙配置,使得配置立即生效
    firewall-cmd --reload
    

连接FTP服务器

  • 配置连接参数

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-UmcnLpcR-1665749663533)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211201110144805.png)]

  • 连接成功之后默认是没有任何文件的

在这里插入图片描述

  • 上传文件进行测试

在这里插入图片描述

显示能够上传成功

  • 删除文件测试成功之后即可代表FTP服务器安装配置成功。
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
SolarWinds Serv-U version 15.1.2 Hotfix 2 ----------------------------------------- This fix contains solutions for the following issues: 1) SQL injection vulnerability in the invitation link used by secure file sharing. 2) Persistent cross-site scripting vulnerability in file sharing. 3) Vulnerability which allows for the injection of additional email headers by using a crafter subject in an upload or download request. Installation Instructions ------------------------- This hotfix requires updating Serv-U. Within the Serv-U folder there is a folder for each supported platform. Please use the files for your appropriate platform when updating Serv-U. The folder contains files with the appropriate directory structure (if necessary) to upgrade your installation. This hotfix requires Serv-U version 15.1.2 Hotfix 1 ------------------------- TO INSTALL: 1) Shut down all running Serv-U processes. i) Right-click the tray icon, and then select "Stop Serv-U". ii) Right-click the tray icon, and then select "Exit Tray". 2) Make a backup copy of the following files: Windows: <Serv-U-InstallDir>\Serv-U.exe <Serv-U-InstallDir>\Serv-U.dll <Serv-U-InstallDir>\Serv-U-RES.dll <Serv-U-InstallDir>\RhinoNET.dll <Serv-U-InstallDir>\RhinoRES.dll <Serv-U-InstallDir>\Client\Web Client\Share\GuestDownload.htm <Serv-U-InstallDir>\Client\Web Client\Share\GuestUpload.htm <Serv-U-InstallDir>\Client\Web Client\Share\ShareDetails.htm Linux: <Serv-U-InstallDir>\Serv-U <Serv-U-InstallDir>\Client\Web Client\Share\GuestDownload.htm <Serv-U-InstallDir>\Client\Web Client\Share\GuestUpload.htm <Serv-U-InstallDir>\Client\Web Client\Share\ShareDetails.htm 3) Extract the ZIP file to a temporary location. 4) Open the folder for the platform Serv-U is installed on. For example, open the "Windows 32-bit" folder if Serv-U is installed on a 32-bit version of Windows. 5) Copy the contents of this folder to your Serv-U installation directory. For Windows, the default installation directory is: C:\Program Files\RhinoSoft\Serv-U -or- C:\Program Files\RhinoSoft.com\Serv-U For Linux, the default installation directory is: /usr/local/Serv-U 6) On Linux, modify the permissions of the files by executing the following command: chmod u+xs Serv-U 7) Restart the Serv-U tray application. 8) Right-click the tray icon, and then select "Start Serv-U". After applying this hotfix, the issues outlined in the description should no longer occur. ------------------------- TO UNINSTALL: 1) Shut down all running Serv-U processes. i) Right-click the tray icon, and then select "Stop Serv-U". ii) Right-click the tray icon, and then select "Exit Tray". 2) Replace the following files with your backed up copies: Windows: <Serv-U-InstallDir>\Serv-U.exe <Serv-U-InstallDir>\Serv-U.dll <Serv-U-InstallDir>\Serv-U-RES.dll <Serv-U-InstallDir>\RhinoNET.dll <Serv-U-InstallDir>\RhinoRES.dll <Serv-U-InstallDir>\Client\Web Client\Share\GuestDownload.htm <Serv-U-InstallDir>\Client\Web Client\Share\GuestUpload.htm <Serv-U-InstallDir>\Client\Web Client\Share\ShareDetails.htm Linux: <Serv-U-InstallDir>\Serv-U <Serv-U-InstallDir>\Client\Web Client\Share\GuestDownload.htm <Serv-U-InstallDir>\Client\Web Client\Share\GuestUpload.htm <Serv-U-InstallDir>\Client\Web Client\Share\ShareDetails.htm 3) Restart the Serv-U tray application. 4) Right-click the tray icon, and then select "Start Serv-U". ------------------------- Key和Backup两个选项,然后点Patch完成注册; 如果出现“File Serv-U.dll obscure”提示而无法勾选那两个选项,是因为将32位和64位的破解方法搞混,并不是文件被锁 定、进程占用或只读写保护等等问题,因为Serv-U.dll可以直接被删除,只要针对版本使用对应破解方法即可。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

肉蟹宝

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值