tft每日頭條

 > 科技

 > centos搭建ftp服務器

centos搭建ftp服務器

科技 更新时间:2024-07-31 16:21:57

centos搭建ftp服務器?查看是否安裝ftp rpm -qa | grep vsftpd安裝ftp yum -y install vsftpd,我來為大家科普一下關于centos搭建ftp服務器?下面希望有你要的答案,我們一起來看看吧!

centos搭建ftp服務器(CentOS7環境下搭建ftp服務器)1

centos搭建ftp服務器

查看是否安裝ftp rpm -qa | grep vsftpd

安裝ftp yum -y install vsftpd

啟動 /bin/systemctl start vsftpd.service

重啟 /bin/systemctl restart vsftpd.service

查看狀态 /bin/systemctl status vsftpd.service

開機自啟chkconfig vsftpd on

取消匿名登錄 vi /etc/vsftpd/vsftpd.conf

anonymous_enable=YES,改為NO

創建ftp用戶組 groupadd ftpgroups

創建ftp用戶,并加入ftpgroups組,/home/ftp是自己建的目錄,不存在就自己創建

useradd -d /home/ftp -g ftpgroups ftptest(用戶名)

限定用戶ftptest不能telnet,隻能ftp usermod -s /sbin/nologin ftptest

用戶test恢複正常 usermod -s /sbin/bash ftptest

更改用戶的主目錄為/home/ftp/test

usermod -d /home/ftp/test ftptest

設置用戶密碼 passwd ftptest

參數配置

(1)vi /etc/SELINUX/config

SELINUX=enforcing 設置成SELINUX=disabled

刷新 source /etc/selinux/config

(2)vim /etc/vsftpd/user_list 禁止登錄用戶配置文件

如果要登錄的用戶在裡面,删除此用戶

(3)vim /etc/vsftpd/vsftpd.conf

allow_writeable_chroot=YES

anonymous_enable=YES

anon_upload_enable=YES

anon_mkdir_write_enable=YES

1

2

3

4

(4)vi /etc/sysconfig/IPTABLES-config

添加下面一行IPTABLES_MODULES="ip_conntrack_ftp"

測試

在windows 輸入ftp://ip地址登錄

,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关科技资讯推荐

热门科技资讯推荐

网友关注

Copyright 2023-2024 - www.tftnews.com All Rights Reserved