vim /usr/lib/systemd/system/sshd.service
[Unit]
Description=OpenSSH server daemon
Documentation=man:sshd(8) man:sshd_config(5)
After=network.target sshd-keygen.service
Wants=sshd-keygen.service [Service]
Type=notify
EnvironmentFile=/etc/sysconfig/sshd
ExecStart=/usr/sbin/sshd -d -D $OPTIONS // 添加-d
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s [Install]
WantedBy=multi-user.target

然后重启服务

systemctl daemon-reload
systemctl restart sshd

查看系统日志

 journalctl  -xe -u sshd  -f

在另开一个终端,使用ssh登录不同用户就会看到debug信息

-- Subject: Unit sshd.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit sshd.service has finished starting up.
--
-- The start-up result is done.
Jul 02 15:26:52 prophet268 sshd[27633]: debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:cNmWmzJVrXuESZXn75p+5vaYwcRdTgn3A+EorcM+k2Y
Jul 02 15:26:52 prophet268 sshd[27633]: debug1: private host key #2: ssh-ed25519 SHA256:hH55TxiE+wxkXJGnbipDvFdyHZSAkV5XZxM22L3pIkc
Jul 02 15:26:52 prophet268 sshd[27633]: debug1: rexec_argv[0]='/usr/sbin/sshd'
Jul 02 15:26:52 prophet268 sshd[27633]: debug1: rexec_argv[1]='-d'
Jul 02 15:26:52 prophet268 sshd[27633]: debug1: rexec_argv[2]='-D'
Jul 02 15:26:52 prophet268 sshd[27633]: debug1: Set /proc/self/oom_score_adj from 0 to -1000
Jul 02 15:26:52 prophet268 sshd[27633]: debug1: Bind to port 22 on 0.0.0.0.
Jul 02 15:26:52 prophet268 sshd[27633]: Server listening on 0.0.0.0 port 22.
Jul 02 15:26:52 prophet268 sshd[27633]: debug1: Bind to port 22 on ::.
Jul 02 15:26:52 prophet268 sshd[27633]: Server listening on :: port 22. Jul 02 15:28:58 prophet268 sshd[27633]: debug1: Server will not fork when running in debugging mode.
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
Jul 02 15:28:58 prophet268 sshd[27633]: rexec line 42: Deprecated option RSAAuthentication
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: sshd version OpenSSH_7.4, OpenSSL 1.0.2k-fips 26 Jan 2017
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: inetd sockets after dupping: 3, 3
Jul 02 15:28:58 prophet268 sshd[27633]: Connection from ::1 port 45036 on ::1 port 22
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: private host key #0: ssh-rsa SHA256:R8GeBmf5SzJ22r7wpGyUuXhYQnhxPyVNZHQShdjAldI
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:cNmWmzJVrXuESZXn75p+5vaYwcRdTgn3A+EorcM+k2Y
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: private host key #2: ssh-ed25519 SHA256:hH55TxiE+wxkXJGnbipDvFdyHZSAkV5XZxM22L3pIkc
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: Client protocol version 2.0; client software version OpenSSH_7.4
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: match: OpenSSH_7.4 pat OpenSSH* compat 0x04000000
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: Local version string SSH-2.0-OpenSSH_7.4
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: Enabling compatibility mode for protocol 2.0
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: SELinux support enabled [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: permanently_set_uid: 74/74 [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: SSH2_MSG_KEXINIT sent [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: SSH2_MSG_KEXINIT received [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: kex: algorithm: curve25519-sha256 [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: kex: curve25519-sha256 need=64 dh_need=64 [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: kex: curve25519-sha256 need=64 dh_need=64 [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: rekey after 134217728 blocks [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: SSH2_MSG_NEWKEYS sent [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: expecting SSH2_MSG_NEWKEYS [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: SSH2_MSG_NEWKEYS received [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: rekey after 134217728 blocks [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: KEX done [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: userauth-request for user root service ssh-connection method none [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: attempt 0 failures 0 [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: reprocess config line 42: Deprecated option RSAAuthentication
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: PAM: initializing for "root"
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: PAM: setting PAM_RHOST to "localhost"
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: PAM: setting PAM_TTY to "ssh"
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: userauth-request for user root service ssh-connection method publickey [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: attempt 1 failures 0 [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: userauth_pubkey: test whether pkalg/pkblob are acceptable for RSA SHA256:TstxdnvVdWV4TzqSNnhHDhTZWzNPoUeTn7DXHgbCVPQ [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: temporarily_use_uid: 0/0 (e=0/0)
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: trying public key file /root/.ssh/authorized_keys
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: fd 4 clearing O_NONBLOCK
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: restore_uid: 0/0
Jul 02 15:28:58 prophet268 sshd[27633]: Failed publickey for root from ::1 port 45036 ssh2: RSA SHA256:TstxdnvVdWV4TzqSNnhHDhTZWzNPoUeTn7DXHgbCVPQ
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: userauth-request for user root service ssh-connection method publickey [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: attempt 2 failures 1 [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: userauth_pubkey: test whether pkalg/pkblob are acceptable for DSA SHA256:K1gn5Xw0/Lodi/6sPHlmTsEFulyjSjjlhx4zii6NLiE [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: temporarily_use_uid: 0/0 (e=0/0)
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: trying public key file /root/.ssh/authorized_keys
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: fd 4 clearing O_NONBLOCK
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: restore_uid: 0/0
Jul 02 15:28:58 prophet268 sshd[27633]: Failed publickey for root from ::1 port 45036 ssh2: DSA SHA256:K1gn5Xw0/Lodi/6sPHlmTsEFulyjSjjlhx4zii6NLiE
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: userauth-request for user root service ssh-connection method publickey [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: attempt 3 failures 2 [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: userauth_pubkey: test whether pkalg/pkblob are acceptable for ECDSA SHA256:ITZJ9Rv6EGeKXqjlU1kYwlxshel9fcBb3WnESEmr6KI [preauth]
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: temporarily_use_uid: 0/0 (e=0/0)
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: trying public key file /root/.ssh/authorized_keys
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: fd 4 clearing O_NONBLOCK
Jul 02 15:28:58 prophet268 sshd[27633]: debug1: restore_uid: 0/0
Jul 02 15:28:58 prophet268 sshd[27633]: Failed publickey for root from ::1 port 45036 ssh2: ECDSA SHA256:ITZJ9Rv6EGeKXqjlU1kYwlxshel9fcBb3WnESEmr6KI
Jul 02 15:29:01 prophet268 sshd[27633]: debug1: userauth-request for user root service ssh-connection method password [preauth]
Jul 02 15:29:01 prophet268 sshd[27633]: debug1: attempt 4 failures 3 [preauth]
Jul 02 15:29:02 prophet268 sshd[27633]: debug1: PAM: password authentication accepted for root
Jul 02 15:29:02 prophet268 sshd[27633]: debug1: do_pam_account: called
Jul 02 15:29:02 prophet268 sshd[27633]: Accepted password for root from ::1 port 45036 ssh2
Jul 02 15:29:02 prophet268 sshd[27633]: debug1: monitor_child_preauth: root has been authenticated by privileged process
Jul 02 15:29:02 prophet268 sshd[27633]: debug1: monitor_read_log: child log fd closed
Jul 02 15:29:02 prophet268 sshd[27633]: debug1: temporarily_use_uid: 0/0 (e=0/0)
Jul 02 15:29:02 prophet268 sshd[27633]: debug1: ssh_gssapi_storecreds: Not a GSSAPI mechanism
Jul 02 15:29:02 prophet268 sshd[27633]: debug1: restore_uid: 0/0
Jul 02 15:29:02 prophet268 sshd[27633]: debug1: SELinux support enabled
Jul 02 15:29:02 prophet268 sshd[27633]: debug1: PAM: establishing credentials

debug 查询服务日志,用于定位服务在运行和启动过程中出现的问题的更多相关文章

  1. Windows平台下Oracle监听服务启动过程中日志输出

    Windows平台下Oracle监听服务启动过程中日志输出记录. 日志目录:D:\app\Administrator\diag\tnslsnr\WIN-RU03CB21QGA\listener\tra ...

  2. Windows平台下Oracle实例启动过程中日志输出

    Windows平台下Oracle实例启动过程中日志输出记录. 路径:D:\app\Administrator\diag\rdbms\orcl\orcl\trace\alert_orcl.log 输出内 ...

  3. springbank 开发日志 Spring启动过程中对自定义标签的处理

    这篇随笔的许多知识来源于:http://www.importnew.com/19391.html 之所以会去看这些东东,主要是希望能够模仿spring mvc的处理流程,做出一套合理的交易处理流程. ...

  4. 微服务日志监控与查询logstash + kafka + elasticsearch

    使用 logstash + kafka + elasticsearch 实现日志监控 https://blog.csdn.net/github_39939645/article/details/788 ...

  5. 【iOS】7.4 定位服务->2.1.3.3 定位 - 官方框架CoreLocation 功能3:区域监听

    本文并非最终版本,如果想要关注更新或更正的内容请关注文集,联系方式详见文末,如有疏忽和遗漏,欢迎指正. 本文相关目录: ================== 所属文集:[iOS]07 设备工具 === ...

  6. 【Android】第18章 位置服务和手机定位—本章示例主界面

    分类:C#.Android.VS2015: 创建日期:2016-03-04 一.简介 目前,基于位置的服务发展迅速,已涉及到商务.医疗.定位.追踪.敏感区域警告.工作和生活等各个方面.定位服务融合了G ...

  7. SpringCloud学习(3)——Eureka服务注册中心及服务发现

    Eureka概述: Eureka是Netflix的一个子模块, 也是核心模块之一.Eureka是一个基于REST的服务, 用于定位服务, 以实现云端中间层服务发现和故障转移.服务注册与发现对于微服务框 ...

  8. Linux服务管理(Ubuntu服务管理工具sysv-rc-conf)(转)

    Linux运行级别 Linux系统任何时候都运行在一个指定的运行级上,并且不同的运行级的程序和服务都不同,所要完成的工作和要达到的目的都不同,系统可以在这些运行级之间进行切换,以完成不同的工作. 运行 ...

  9. 微服务Consul系列之服务注册与服务发现

    在进行服务注册之前先确认集群是否建立,关于服务注册可以看上篇微服务Consul系列之集群搭建的介绍,两种注册方式:一种是注册HTTP API.另一种是通过配置文件定义,下面讲解的是基于后者配置文件定义 ...

随机推荐

  1. mysql upper() 函数

    mysql> select upper(" cdcdcd"); +------------------+ | upper(" cdcdcd") | +-- ...

  2. 去参加了十四届D2前端大会~

    朋友喊我去一起去d2,原来一直在加班,没有想去的动力,后来业务上线,幸运的入手了别人转的一张票(也不便宜啊)- 讲了五个挑战 端侧渲染体系的重塑,从PC时代到无线时代,再到未来的IOT时代,在渲染方面 ...

  3. D3.js的v5版本入门教程(第八章)—— 坐标轴

    D3.js的v5版本入门教程(第八章) D3中没有现成的坐标轴图形,需要我们自己用其他组件拼凑而成.D3中提供了坐标轴组件,使得我们在SVG中绘制一个坐标轴变得像添加一个普通元素那样简单 为了表绘制一 ...

  4. 开启Nginx监控 with-http_stub_status_module

    1.开启监控with-http_stub_status_module ./configure  --with-openssl=/usr/local/ssl  --with-http_stub_stat ...

  5. 004 vue组件

    一:创建组件 1.第一种创建方式 主要有Vue.extend,Vue.component. 注释掉的代码是一步一步的推断,后面的代码是简化的代码. <!DOCTYPE html> < ...

  6. leetcode 10. Regular Expression Matching 、44. Wildcard Matching

    10. Regular Expression Matching https://www.cnblogs.com/grandyang/p/4461713.html class Solution { pu ...

  7. React中跨域问题的完美解决方案

    针对react版本^16.6.0有多种解决方案 方案一:package.json中加上proxy代理配置 在packge.json加入 "proxy": "http:// ...

  8. SUSE操作系统,如何查看操作系统版本?

    背景描述: 今天需要统计操作系统版本,我在其中一台主机上执行cat /etc/redhat-release发现没有这个,应该知道不是redhat系统,然后想,怎么查来着,忘了,找了下,再此记录下. # ...

  9. WebGL调试工具分享

    学习WebGL,我们需要一些好用的调试工具,下面分享3个常用的调试工具. WebGL Inspector 下载地址:https://github.com/benvanik/WebGL-Inspecto ...

  10. Java12新特性 -- Shenandoah GC

    Shenandoah 垃圾回收器是 Red Hat 在 2014 年宣布进行的一项垃圾收集器研究项目 Pauseless GC 的实现,旨在针对 JVM 上的内存收回实现低停顿的需求.该设计将与应用程 ...