大多数人 在 设置SFTP 使用时,会在 ../sshd_config中添加如下内容:

-------------------------------

Subsystem sftp internal-sftp
Match Group sftp
ChrootDirectory /data
ForceCommand internal-sftp
AllowTcpForwarding no
X11Forwarding no

------------------------------

启动时 报如下错误:

-- Unit sshd.service has begun starting up.
2月 07 16:49:31 soc26 sshd[2074]: /etc/ssh/sshd_config line 147: Directive 'Subsystem' is not allowed within a Match block
2月 07 16:49:31 soc26 systemd[1]: sshd.service: control process exited, code=exited status=255
2月 07 16:49:31 soc26 systemd[1]: Failed to start OpenSSH server daemon.
-- Subject: Unit sshd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit sshd.service has failed.
--
-- The result is failed.
2月 07 16:49:31 soc26 systemd[1]: Unit sshd.service entered failed state.
2月 07 16:49:31 soc26 systemd[1]: sshd.service failed.
2月 07 16:49:31 soc26 polkitd[1295]: Unregistered Authentication Agent for unix-process:2067:361270 (system bus name :1.27, object path /org/freedesktop/PolicyKit1/AuthenticationAgent,
2月 07 16:49:46 soc26 polkitd[1295]: Registered Authentication Agent for unix-process:2084:362757 (system bus name :1.28 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /or
2月 07 16:49:46 soc26 systemd[1]: Cannot add dependency job for unit microcode.service, ignoring: Unit is not loaded properly: Invalid argument.
2月 07 16:49:46 soc26 systemd[1]: Starting OpenSSH server daemon...
-- Subject: Unit sshd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit sshd.service has begun starting up.
2月 07 16:49:46 soc26 sshd[2090]: /etc/ssh/sshd_config line 153: Directive 'UseDNS' is not allowed within a Match block
2月 07 16:49:46 soc26 systemd[1]: sshd.service: control process exited, code=exited status=255
2月 07 16:49:46 soc26 systemd[1]: Failed to start OpenSSH server daemon.
-- Subject: Unit sshd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit sshd.service has failed.
--
-- The result is failed.
2月 07 16:49:46 soc26 systemd[1]: Unit sshd.service entered failed state.
2月 07 16:49:46 soc26 systemd[1]: sshd.service failed.
2月 07 16:49:46 soc26 polkitd[1295]: Unregistered Authentication Agent for unix-process:2084:362757 (system bus name :1.28, object path /org/freedesktop/PolicyKit1/AuthenticationAgent,

排除其他可能的原因,可以尝试如下:

Subsystem sftp internal-sftp
Match Group sftp
ChrootDirectory /data
ForceCommand internal-sftp
AllowTcpForwarding no
X11Forwarding no

放在

UseDNS no

之后

就解决了。

centos7 sftp设置后 ssh 启动失败 原因分析的更多相关文章

  1. Linux suse x86_64 环境上部署Hadoop启动失败原因分析

    一.问题症状: 在安装hadoop的时候报类似如下的错误: # A fatal error has beendetected by the Java Runtime Environment: # #  ...

  2. virsh default启动失败原因分析及解决

    启动default时出现如下错误提示:[root@node1 ~]# virsh net-start defaulterror: Failed to start network defaulterro ...

  3. 玩转Windows服务系列——无COM接口Windows服务启动失败原因及解决方案

    将VS创建的Windows服务项目编译生成的程序,通过命令行 “服务.exe -Service”注册为Windows服务后,就可以通过服务管理器进行管理了. 问题 通过服务管理器进行启动的时候,发现服 ...

  4. centos7安装apache http server启动失败--Failed to start The Apache HTTP Server.

    centos7安装apache http server启动失败     除了nginx可以开启http服务外,apche http server也可以开启http服务,安装过程如下:1. 首先,检测是 ...

  5. Tomcat启动失败原因

    Tomcat启动失败原因 一.Tomcat启动时,要求被加载的项目必须拥有独立路径名称 发布的两个工程具有相同路径名称,这是不允许. 二.8080端口号已经被占用了 启动失败原因,就是8085端口上, ...

  6. OpenKM6.2.5的安装和配置详细过程(附启动失败原因)

    继上文“解决OpenKM启动失败的详细历程”过后,这几天一直在使用OpenKM,OpenKM使用起来很简单,但是一些相关配置什么的中文资料较少,且有的资料欠缺正确性,存在误导性,下面就简单将配置过程和 ...

  7. CentOS6.9-zabbix3.2启动失败原因及页面没有mysql选择项

     环境内核信息: [root@zabbix- ~]# uname -a Linux lodboyedu- -.el6.x86_64 # SMP Tue Mar :: UTC x86_64 x86_64 ...

  8. android AVD启动失败原因之一

    在mac上安装好Android SDK.AVD及相关的组件之后,手动创建了一个安卓模拟器后,通过actions启动,会弹出一个提示窗口,然后就闪退,也没有报错什么的,在网上搜了半天AVD启动失败的问题 ...

  9. Windows安装Centos7双系统后Windows启动项消失

    原文: https://www.cnblogs.com/xinglichao/p/9999049.html https://blog.csdn.net/yingzinanfei/article/det ...

随机推荐

  1. 如何解决Visual Studio2010 编译时提示系统找不到指定文件问题

    前一段时间,开始使用vs2010编写程序,可是在编译的时候总是报错,提示系统找不到指定文件,导致无法正常运行程序,花了好久时间终于找到原因解决,是因为常规的输出目录 要与链接的常规的输出文件要相对应. ...

  2. MVC 中Simditor上传本地图片

    1.引用样式和js文件 <link href="~/Content/scripts/plugins/simditor/css/simditor.css" rel=" ...

  3. Linux内核的五大模块

    Linux内核的五大模块 (转自)https://blog.csdn.net/huangjingbin/article/details/19396235 Linux内核的五大模块 1.进程调度模块 2 ...

  4. React Native控件之Picker

    1. import React,{Component}from 'react'; import { AppRegistry, StyleSheet, Text, View, Picker, } fro ...

  5. python 等比数列

    def is_geometric(li): : return True # Calculate ratio ratio = li[]/]) # Check the ratio of the remai ...

  6. 磁条卡,IC卡,ID卡,信用卡芯片卡,信用卡磁条卡 等等的区别

    1.条码卡:该卡卡面上有一串条码,通过扫描枪或者相应的条码读卡器读出该条码卡的卡号.根据条码的不同又分为39码等其它码.条码卡仅仅是一个编号,不存蓄其它内容.特点:价格便宜类似磁卡. 2.磁条卡:类似 ...

  7. 电脑上装两个JDK的方法

    在window操作系统上配置两个JDK方便开发以及新JDK的学习 我的机子上的JDk环境为1.8 在cmd中执行:java -version 查看JDK版本 安装方法 在系统变量中配置中设置JAVA_ ...

  8. 视图层view layer

    视图层是Django处理请求的核心代码层,我们大多数Python代码都集中在这一层面. 它对外接收用户请求,对内调度模型层和模版层,统合数据库和前端,最后根据业务逻辑,将处理好的数据,与前端结合,返回 ...

  9. 新的请求方式 fetch和axios

    参考链接:https://www.javascriptcn.com/read-5840.html axios使用文档: https://www.kancloud.cn/yunye/axios/2348 ...

  10. 解决dos窗口乱码问题

    大家有没有遇到这样的情况,看着就糟心 打开dos窗口, 输入命令 chcp 936 (936表示中文编码GBK, 也可以设置其他编码), 回车一下执行.  鼠标右键 -> 属性  (关键一步): ...