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. 百度地图web api使用案例

    效果如下: 1.获取位置的经纬度: 如坐标:114.110033,22.541098 获取经纬度: http://api.map.baidu.com/lbsapi/getpoint/index.htm ...

  2. Git学习之连接GitHub远程仓库

    在看此教程之前电脑上应该已安装好git,并且配置好基本信息,Git新手请从头开始. 第1步:创建SSH Key 在用户主目录下(Mac系统是在用户主目录下,可通过命令ll -a查看,Windows下自 ...

  3. ubuntu 18.04//18.10&&windows 7/10双系统系统时间不一致

    新版本的Ubuntu使用systemd启动之后,时间也改成了由timedatectl来管理,因此网上的许多方法就不适用了. 经过测试发现下面的方法可以解决双系统时间不一致问题: 1.将硬件时间UTC改 ...

  4. TensorFlow从入门到理解(五):你的第一个循环神经网络RNN(回归例子)

    运行代码: import tensorflow as tf import numpy as np import matplotlib.pyplot as plt BATCH_START = 0 TIM ...

  5. sublime text 3 3103 注册码

    —– BEGIN LICENSE —– Ryan Clark Single User License EA7E-812479 2158A7DE B690A7A3 8EC04710 006A5EEB 3 ...

  6. 检查CentOS7定时任务是否启用并执行过

    1 监控cron状态 service crontab status #如果没有开启执行 service crontab start 正常开启的状态 2 检查执行日志,过滤自己配置的定时任务脚本关键字 ...

  7. python笔记---数据基础类型

    s = 'laonanHai' s1 = s.capitalize() #首字母大写,其他字母小写 s2 = s.upper() #全部大写 s3 = s.lower() #全部小写 print(s, ...

  8. python之读写文件

    1. 读取文件数据,文件必须存在才可以读且如要读取的文件不和当前.py在同一个包下,需要特别指定此文件路径才行 f=open('test.txt',encoding='utf-8')#填写文件路径,打 ...

  9. Python 爬虫五 进阶案例-web微信登陆与消息发送

    首先回顾下网页微信登陆的一般流程 1.打开浏览器输入网址 2.使用手机微信扫码登陆 3.进入用户界面 1.打开浏览器输入网址 首先打开浏览器输入web微信网址,并进行监控: https://wx.qq ...

  10. Shiro入门 - 通过自定义Realm连数数据库进行认证(md5+salt形式)

    shiro-realm-md5.ini [main] #定义凭证匹配器 credentialsMatcher=org.apache.shiro.authc.credential.HashedCrede ...