centos7.6 安装及配置ftp服务

Last login: Mon Feb 25 14:00:45 2019 from 172.16.5.80
[root@localhost ~]# yum install -y vsftpd
已加载插件:fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
zabbix | 2.9 kB 00:00:00
zabbix-non-supported | 951 B 00:00:00
(1/5): base/7/x86_64/group_gz | 166 kB 00:00:01
(2/5): zabbix/x86_64/primary_db | 46 kB 00:00:04
(3/5): extras/7/x86_64/primary_db | 180 kB 00:00:05
(4/5): updates/7/x86_64/primary_db | 2.4 MB 00:00:05
(5/5): base/7/x86_64/primary_db | 6.0 MB 00:00:09
Determining fastest mirrors
* base: mirrors.163.com
* extras: mirrors.aliyun.com
* updates: mirrors.163.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 vsftpd.x86_64.0.3.0.2-25.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=======================================================================================
Package 架构 版本 源 大小
=======================================================================================
正在安装:
vsftpd x86_64 3.0.2-25.el7 base 171 k

事务概要
=======================================================================================
安装 1 软件包

总下载量:171 k
安装大小:353 k
Downloading packages:
vsftpd-3.0.2-25.el7.x86_64.rpm | 171 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : vsftpd-3.0.2-25.el7.x86_64 1/1
验证中 : vsftpd-3.0.2-25.el7.x86_64 1/1

已安装:
vsftpd.x86_64 0:3.0.2-25.el7

完毕!

[root@localhost ~]# systemctl start vsftpd.service
[root@localhost ~]# systemctl status vsftpd.service
● vsftpd.service - Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
Active: active (running) since 二 2019-02-26 22:46:16 CST; 12s ago
Process: 14762 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)
Main PID: 14763 (vsftpd)
CGroup: /system.slice/vsftpd.service
└─14763 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

2月 26 22:46:16 localhost.localdomain systemd[1]: Starting Vsftpd ftp daemon...
2月 26 22:46:16 localhost.localdomain systemd[1]: Started Vsftpd ftp daemon.
[root@localhost ~]# yum install -y psmisc net-tools systemd-devel libdb-devel perl-DBI
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.aliyun.com
* updates: mirrors.163.com
软件包 libdb-devel-5.3.21-24.el7.x86_64 已安装并且是最新版本
软件包 perl-DBI-1.627-4.el7.x86_64 已安装并且是最新版本
正在解决依赖关系
--> 正在检查事务
---> 软件包 net-tools.x86_64.0.2.0-0.17.20131004git.el7 将被 升级
---> 软件包 net-tools.x86_64.0.2.0-0.24.20131004git.el7 将被 更新
---> 软件包 psmisc.x86_64.0.22.20-15.el7 将被 安装
---> 软件包 systemd-devel.x86_64.0.219-62.el7_6.5 将被 安装
--> 正在处理依赖关系 systemd-libs = 219-62.el7_6.5,它被软件包 systemd-devel-219-62.el7_6.5.x86_64 需要
--> 正在处理依赖关系 systemd = 219-62.el7_6.5,它被软件包 systemd-devel-219-62.el7_6.5.x86_64 需要
--> 正在检查事务
---> 软件包 systemd.x86_64.0.219-30.el7 将被 升级
--> 正在处理依赖关系 systemd = 219-30.el7,它被软件包 systemd-sysv-219-30.el7.x86_64 需要
---> 软件包 systemd.x86_64.0.219-62.el7_6.5 将被 更新
--> 正在处理依赖关系 libcryptsetup.so.12(CRYPTSETUP_2.0)(64bit),它被软件包 systemd-219-62.el7_6.5.x86_64 需要
--> 正在处理依赖关系 liblz4.so.1()(64bit),它被软件包 systemd-219-62.el7_6.5.x86_64 需要
--> 正在处理依赖关系 libcryptsetup.so.12()(64bit),它被软件包 systemd-219-62.el7_6.5.x86_64 需要
---> 软件包 systemd-libs.x86_64.0.219-30.el7 将被 升级
--> 正在处理依赖关系 systemd-libs = 219-30.el7,它被软件包 libgudev1-219-30.el7.x86_64 需要
---> 软件包 systemd-libs.x86_64.0.219-62.el7_6.5 将被 更新
--> 正在检查事务
---> 软件包 cryptsetup-libs.x86_64.0.1.7.2-1.el7 将被 升级
---> 软件包 cryptsetup-libs.x86_64.0.2.0.3-3.el7 将被 更新
---> 软件包 libgudev1.x86_64.0.219-30.el7 将被 升级
---> 软件包 libgudev1.x86_64.0.219-62.el7_6.5 将被 更新
---> 软件包 lz4.x86_64.0.1.7.5-2.el7 将被 安装
---> 软件包 systemd-sysv.x86_64.0.219-30.el7 将被 升级
---> 软件包 systemd-sysv.x86_64.0.219-62.el7_6.5 将被 更新
--> 解决依赖关系完成

依赖关系解决

=======================================================================================
Package 架构 版本 源 大小
=======================================================================================
正在安装:
psmisc x86_64 22.20-15.el7 base 141 k
systemd-devel x86_64 219-62.el7_6.5 updates 200 k
正在更新:
net-tools x86_64 2.0-0.24.20131004git.el7 base 306 k
为依赖而安装:
lz4 x86_64 1.7.5-2.el7 base 98 k
为依赖而更新:
cryptsetup-libs x86_64 2.0.3-3.el7 base 338 k
libgudev1 x86_64 219-62.el7_6.5 updates 96 k
systemd x86_64 219-62.el7_6.5 updates 5.1 M
systemd-libs x86_64 219-62.el7_6.5 updates 407 k
systemd-sysv x86_64 219-62.el7_6.5 updates 84 k

事务概要
=======================================================================================
安装 2 软件包 (+1 依赖软件包)
升级 1 软件包 (+5 依赖软件包)

总下载量:6.7 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/9): libgudev1-219-62.el7_6.5.x86_64.rpm | 96 kB 00:00:00
(2/9): lz4-1.7.5-2.el7.x86_64.rpm | 98 kB 00:00:01
(3/9): systemd-devel-219-62.el7_6.5.x86_64.rpm | 200 kB 00:00:00
(4/9): cryptsetup-libs-2.0.3-3.el7.x86_64.rpm | 338 kB 00:00:02
(5/9): systemd-libs-219-62.el7_6.5.x86_64.rpm | 407 kB 00:00:00
(6/9): systemd-sysv-219-62.el7_6.5.x86_64.rpm | 84 kB 00:00:00
(7/9): psmisc-22.20-15.el7.x86_64.rpm | 141 kB 00:00:03
(8/9): systemd-219-62.el7_6.5.x86_64.rpm | 5.1 MB 00:00:05
net-tools-2.0-0.24.20131004git FAILED
http://mirrors.njupt.edu.cn/centos/7.6.1810/os/x86_64/Packages/net-tools-2.0-0.24.20131004git.el7.x86_64.rpm: [Errno 12] Timeout on http://10.10.254.10/cache/4/01/mirrors.njupt.edu.cn/403efb951a050f3895fe0328883a7298/net-tools-2.0-0.24.20131004git.el7.x86_64.rpm: (28, 'Connection timed out after 30869 milliseconds')
正在尝试其它镜像。
(9/9): net-tools-2.0-0.24.20131004git.el7.x86_64.rpm | 306 kB 00:00:00
---------------------------------------------------------------------------------------
总计 216 kB/s | 6.7 MB 00:31
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : lz4-1.7.5-2.el7.x86_64 1/15
正在更新 : systemd-libs-219-62.el7_6.5.x86_64 2/15
正在更新 : cryptsetup-libs-2.0.3-3.el7.x86_64 3/15
正在更新 : systemd-219-62.el7_6.5.x86_64 4/15
正在更新 : net-tools-2.0-0.24.20131004git.el7.x86_64 5/15
正在安装 : systemd-devel-219-62.el7_6.5.x86_64 6/15
正在更新 : systemd-sysv-219-62.el7_6.5.x86_64 7/15
正在更新 : libgudev1-219-62.el7_6.5.x86_64 8/15
正在安装 : psmisc-22.20-15.el7.x86_64 9/15
清理 : systemd-sysv-219-30.el7.x86_64 10/15
清理 : libgudev1-219-30.el7.x86_64 11/15
清理 : net-tools-2.0-0.17.20131004git.el7.x86_64 12/15
清理 : systemd-219-30.el7.x86_64 13/15
清理 : cryptsetup-libs-1.7.2-1.el7.x86_64 14/15
清理 : systemd-libs-219-30.el7.x86_64 15/15
验证中 : cryptsetup-libs-2.0.3-3.el7.x86_64 1/15
验证中 : systemd-219-62.el7_6.5.x86_64 2/15
验证中 : net-tools-2.0-0.24.20131004git.el7.x86_64 3/15
验证中 : libgudev1-219-62.el7_6.5.x86_64 4/15
验证中 : systemd-devel-219-62.el7_6.5.x86_64 5/15
验证中 : lz4-1.7.5-2.el7.x86_64 6/15
验证中 : psmisc-22.20-15.el7.x86_64 7/15
验证中 : systemd-libs-219-62.el7_6.5.x86_64 8/15
验证中 : systemd-sysv-219-62.el7_6.5.x86_64 9/15
验证中 : systemd-libs-219-30.el7.x86_64 10/15
验证中 : systemd-219-30.el7.x86_64 11/15
验证中 : net-tools-2.0-0.17.20131004git.el7.x86_64 12/15
验证中 : systemd-sysv-219-30.el7.x86_64 13/15
验证中 : libgudev1-219-30.el7.x86_64 14/15
验证中 : cryptsetup-libs-1.7.2-1.el7.x86_64 15/15

已安装:
psmisc.x86_64 0:22.20-15.el7 systemd-devel.x86_64 0:219-62.el7_6.5

作为依赖被安装:
lz4.x86_64 0:1.7.5-2.el7

更新完毕:
net-tools.x86_64 0:2.0-0.24.20131004git.el7

作为依赖被升级:
cryptsetup-libs.x86_64 0:2.0.3-3.el7 libgudev1.x86_64 0:219-62.el7_6.5
systemd.x86_64 0:219-62.el7_6.5 systemd-libs.x86_64 0:219-62.el7_6.5
systemd-sysv.x86_64 0:219-62.el7_6.5

完毕!
[root@localhost ~]# systemctl restart vsftpd.service
[root@localhost ~]# systemctl status vsftpd.service
● vsftpd.service - Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
Active: active (running) since 二 2019-02-26 22:48:08 CST; 3s ago
Process: 14884 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)
Main PID: 14885 (vsftpd)
CGroup: /system.slice/vsftpd.service
└─14885 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

2月 26 22:48:08 localhost.localdomain systemd[1]: Stopped Vsftpd ftp daemon.
2月 26 22:48:08 localhost.localdomain systemd[1]: Starting Vsftpd ftp daemon...
2月 26 22:48:08 localhost.localdomain systemd[1]: Started Vsftpd ftp daemon.
[root@localhost ~]# systemctl enable vsftpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.
[root@localhost ~]# cd /etc/vsftpd
[root@localhost vsftpd]# ls
ftpusers user_list vsftpd.conf vsftpd_conf_migrate.sh
[root@localhost vsftpd]# ls -l
总用量 20
-rw------- 1 root root 125 10月 31 03:45 ftpusers
-rw------- 1 root root 361 10月 31 03:45 user_list
-rw------- 1 root root 5116 10月 31 03:45 vsftpd.conf
-rwxr--r-- 1 root root 338 10月 31 03:45 vsftpd_conf_migrate.sh
[root@localhost vsftpd]# cat ftpusers
# Users that are not allowed to login via ftp
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
[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
~
"ftpusers" 14L, 120C 已写入
[root@localhost vsftpd]# cat ftpusers
# Users that are not allowed to login via ftp
#root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
[root@localhost vsftpd]# systemctl restart vsftpd.service
[root@localhost vsftpd]# systemctl status vsftpd.service
● vsftpd.service - Vsftpd ftp daemon
Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled)
Active: active (running) since 二 2019-02-26 23:00:12 CST; 8s ago
Process: 14929 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)
Main PID: 14930 (vsftpd)
CGroup: /system.slice/vsftpd.service
└─14930 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

2月 26 23:00:12 localhost.localdomain systemd[1]: Stopped Vsftpd ftp daemon.
2月 26 23:00:12 localhost.localdomain systemd[1]: Starting Vsftpd ftp daemon...
2月 26 23:00:12 localhost.localdomain systemd[1]: Started Vsftpd ftp daemon.

[root@localhost vsftpd]# cd /etc/vsftpd
[root@localhost vsftpd]# ls
ftpusers user_list vsftpd.conf vsftpd_conf_migrate.sh
[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
"ftpusers" 15L, 126C 已写入
[root@localhost vsftpd]# cat 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
[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
"user_list" 20L, 362C 已写入
[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
"ftpusers" 15L, 125C 已写入
[root@localhost vsftpd]# systemctl restart vsftpd.service
[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
"ftpusers" 15L, 126C 已写入
[root@localhost vsftpd]# systemctl restart vsftpd.service

猜你喜欢

转载自www.cnblogs.com/tiantom/p/10441313.html