安装ao 服务器为空,『运维』ftp链接linux服务器

一、安装ftp服务

[root@localhost ~]# yum install -y vsftpd

二、关闭防火墙 [centos7为例]

查看防火墙状态,running 代表正在运行

[root@localhost ~]# systemctl status firewalld

firewalld.service - firewalld - dynamic firewall daemon

Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)

Active: active (running) since Wed 2020-08-26 00:43:26 CST; 1h 12min ago

Docs: man:firewalld(1)

Main PID: 604 (firewalld)

CGroup: /system.slice/firewalld.service

└─604 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopi

关闭防火墙

[root@localhost ~]# systemctl stop firewalld

永久关闭防火墙

[root@localhost ~]# systemctl disable firewalld

Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

三、修改selinux配置,关闭selinux

[root@localhost ~]# vim /etc/selinux/config

SELINUX=disabled

四、配置vsftpd

查看配置vsftpd文件

[root@localhost ~]# cd /etc/vsftpd/

[root@localhost vsftpd]# ll

total 20

-rw-------. 1 root root 125 Apr 1 12:55 ftpusers

-rw-------. 1 root root 361 Apr 1 12:55 user_list

-rw-------. 1 root root 5116 Apr 1 12:55 vsftpd.conf

-rwxr--r--. 1 root root 338 Apr 1 12:55 vsftpd_conf_migrate.sh

配置ftpusers,将root注释

[root@localhost vsftpd]# vim ftpusers

# Users that are not allowed to login via ftp

# root

bin

daemon

adm

lp

sync

shutdown

halt

mail

news

uucp

operator

games

nobody

~

配置user_list,将root注释

[root@localhost vsftpd]# vim user_list

# vsftpd userlist

# If userlist_deny=NO, only allow users in this file

# If userlist_deny=YES (default), never allow users in this file, and

# do not even prompt for a password.

# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers

# for users that are denied.

# root

bin

daemon

adm

lp

sync

shutdown

halt

mail

news

uucp

operator

games

nobody

配置vsftpd.conf

anonymous_enable=NO //禁止匿名登陆

chown_uploads=YES //允许上传文件

anon_upload_enable=YES //selinux未关闭时允许上传文件

anon_mkdir_write_enable=YES //允许创建可写的目录

五、重启服务并加入开机自启动即可

[root@localhost ~]# sysytemctl restart vsftpd

[root@localhost ~]# sysytemctl enable vsftpd

Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值