1:环境:centos7

2:当在重启centos7 linux服务器后,再连接ftp客户端不能链接

此时需要检查以下几点:

2-1:核查ftp服务是否启动正常:

 [root@localhost ~]# service vsftpd status
Redirecting to /bin/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 Fri 2017-08-25 09:20:59 CST; 30s ago
Process: 4517 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)
Main PID: 4520 (vsftpd)
CGroup: /system.slice/vsftpd.service
└─4520 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf Aug 25 09:20:59 localhost.localdomain systemd[1]: Starting Vsftpd ftp daemon...
Aug 25 09:20:59 localhost.localdomain systemd[1]: Started Vsftpd ftp daemon.

如果是ftp服务没有启动起来:则需要执行启动命令

 service vsftpd restart

或者是设置ftp服务开机自动启动;如何设置请参考《CentOS7 搭建FTP服务器》的“七:解决 linux系统重启后 用ftp工具无法访问的问题”的内容

2-2:核查firewall防火墙是否启动正常:

 [root@localhost ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2017-08-25 09:00:20 CST; 25min ago
Docs: man:firewalld(1)
Main PID: 803 (firewalld)
CGroup: /system.slice/firewalld.service
└─803 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid Aug 25 09:00:13 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Aug 25 09:00:20 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

如果是firewall 服务没有启动起来,则需要手动启动

 [root@localhost ~]# systemctl restart firewalld.service
#并核查下 启动的端口情况
[root@localhost ~]# firewall-cmd --zone=public --list-ports
80/tcp 8080/tcp
#如果没有自己想要的端口,则添加端口,然后在重启firewall
[root@localhost ~]# firewall-cmd --zone=public --add-port=21/tcp --permanent
success
[root@localhost ~]# systemctl restart firewalld.service
[root@localhost ~]# firewall-cmd --zone=public --list-ports
21/tcp 80/tcp 8080/tcp

2-3:核查iptables  的状态是否启动正常。

 [root@localhost ~]# service iptables status
Redirecting to /bin/systemctl status iptables.service
● iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)
Active: inactive (dead)
[root@localhost ~]#

如果 没有正常启动,则需要手动启动该服务。

 [root@localhost ~]# service iptables restart
 

设置正常开机启动该服务:

 [root@localhost ~]# cd /etc/rc.d
[root@localhost rc.d]# ls
init.d rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d rc.local
[root@localhost rc.d]# cat rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot. touch /var/lock/subsys/local /etc/init.d/nginx start
[root@localhost rc.d]# vi rc.local

在rc.loal 文件中添加  service iptables restart  确定命令

以下是 红色标注的内容是 添加的启动iptables服务的内容

 [root@localhost ~]# cd /etc/rc.d/
[root@localhost rc.d]# ls
init.d rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d rc.local
[root@localhost rc.d]# cat rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot. touch /var/lock/subsys/local #开机默认启动nginx服务
/etc/init.d/nginx start
#开机重启 ip 防火墙

service iptables restart

 [root@localhost rc.d]#
 

如果以上3个服务都启动正常,则ftp客户端连接应该是正常的。若还有问题,则需要仔细核查

处理ftp服务器 在重启后ftp客户端不能连接访问的问题的更多相关文章

  1. 【转】Linux环境搭建FTP服务器与Python实现FTP客户端的交互介绍

    Linux环境搭建FTP服务器与Python实现FTP客户端的交互介绍 FTP 是File Transfer Protocol(文件传输协议)的英文简称,它基于传输层协议TCP建立,用于Interne ...

  2. 在虚拟机上安装redis集群,redis使用版本为4.0.5,本机通过命令客户端可以连接访问,外部主机一直访问不了

    在虚拟机上安装了redis 4 ,启动后本机客户端可以连接访问,但是外部主机一直访问不了,在使用java代码连接redis集群时报:no reachable node in cluster,原因:在r ...

  3. 映射内网ftp服务器到公网后内网访问出错问题

    上文说道映射后外网无法访问解决:https://www.cnblogs.com/Dev0ps/p/9073048.html 添加了ftp的pasv_address的地址 ,内网客户端要设置主动模式(a ...

  4. ftp服务器终端登录后乱码处理方法

    首先在windows上用资源管理器登录看看会不会乱码,如果不会,说明是GBK编码 因为windows默认是GBK(936),linux默认(UTF-8) 因为FTP服务器我们修改不了,如果用linux ...

  5. Linux上的ftp服务器vsftpd之配置满天飞--设置匿名用户访问(不弹出用户名密码框)以及其他用户可正常上传

    一.问题背景 没事谁折腾这鬼玩意哦...还不是因为bug. 我们的应用,用户头像是存在ftp上的.之前的ftp服务器是一台windows,我们后台服务器程序收到用户上传头像的请求时,会用一个ROOT/ ...

  6. 服务器部署网站后,公网ip可以访问,域名不能访问问题(稳)

    出现问题 这几天我网站已经部署到vps上,域名也备好案,想使用域名指向我们公网ip.指完发现用域名访问不了网站,但是公网ip可以.于是看了网上资料,好像是要清除浏览器DNS缓存,我清完没用.然后发现我 ...

  7. Redis Cluster集群搭建后,客户端的连接研究(Spring/Jedis)(待实践)

    说明:无论是否已经搭建好集群,还是使用什么样的客户端去连接,都是必须把全部IP列表集成进去,然后随机往其中一个IP写. 这样做的好处: 1.随机IP写入之后,Redis Cluster代理层会自动根据 ...

  8. 【大话QT之十】实现FTP断点续传(需要设置ftp服务器为“PASV”被动接收方式)

    应用需求: 网盘开发工作逐步进入各部分的整合阶段,当用户在客户端修改或新增加一个文件时,该文件要同步上传到服务器端对应的用户目录下,因此针对数据传输(即:上传.下载)这一块现在既定了三种传输方式,即: ...

  9. 外网访问内网的FTP服务器

    转自 外网访问内网的FTP服务器 首先感谢作者给出的总结,原文是介绍Serv-U的,我针对FileZilla Server进行了稍微修改,仅看操作可直接跳到分割线后第3部分. 1. 背景简介最近研究如 ...

随机推荐

  1. mvc 分页PagedList简单使用

    1.nuget下载PagedList包 2.PageListHelper类: using PagedList; using System; using System.Collections.Gener ...

  2. Myschool乱码问题 和mysql 备份还原

    show variables like 'character_set%'; alter table users modify username ) character set gbk; alter t ...

  3. Codeforces 1065E(计数)

    题目链接 题意 限定字符串长度为$n$,字符集规模为$A$,以及$m$个数字$b$,对于任意数字$bi$满足长度为$bi$的前缀和后缀先反转再交换位置后形成的新串与原串视作相等,问存在多少不同串. 思 ...

  4. 第27月第28天 iOS bundle

    1. 7.如果将自己打包的bundle给别人使用,别人在打包上传过程中可能会遇到错误提示如: ERROR ITMS-90171: "Invalid Bundle Structure - Th ...

  5. 第20月第14天 objc_getAssociatedObject _cmd

    1. - (CustomNavigationControllerDelegate *)customDelegate { return objc_getAssociatedObject(self, _c ...

  6. Element-ui 中dialog的使用方法

    <template> <div> <el-button type="text" @click="dialogFormVisible = tr ...

  7. Django REST Framework API Guide 04

    本节大纲 1.serializers 1.Serializers Serializers允许复杂的数据,像queryset和模型实例转换成源生的Python数据类型.从而可以更简单的被渲染成JSON, ...

  8. 关于vmvawe的光驱,iso镜像,挂载,卸载

    勾选这个使用iso镜像文件,就相当于真实的环境下,将一张光盘插进了光驱里,然后再勾选启动时连接,那么在linux开机后,/dev/cdrom或者/dev/sr0(前者是后者的软连接)就表示这个硬件设备 ...

  9. shiro-5基于url的权限管理

    1.1 搭建环境 1.1.1 数据库 mysql5.1数据库中创建表:用户表.角色表.权限表(实质上是权限和资源的结合 ).用户角色表.角色权限表. 完成权限管理的数据模型创建. 1.1.2 开发环境 ...

  10. 连接 sqlserver

    提示错误:Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: 通过端口 1433 ...