debug 查询服务日志,用于定位服务在运行和启动过程中出现的问题
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 查询服务日志,用于定位服务在运行和启动过程中出现的问题的更多相关文章
- Windows平台下Oracle监听服务启动过程中日志输出
Windows平台下Oracle监听服务启动过程中日志输出记录. 日志目录:D:\app\Administrator\diag\tnslsnr\WIN-RU03CB21QGA\listener\tra ...
- Windows平台下Oracle实例启动过程中日志输出
Windows平台下Oracle实例启动过程中日志输出记录. 路径:D:\app\Administrator\diag\rdbms\orcl\orcl\trace\alert_orcl.log 输出内 ...
- springbank 开发日志 Spring启动过程中对自定义标签的处理
这篇随笔的许多知识来源于:http://www.importnew.com/19391.html 之所以会去看这些东东,主要是希望能够模仿spring mvc的处理流程,做出一套合理的交易处理流程. ...
- 微服务日志监控与查询logstash + kafka + elasticsearch
使用 logstash + kafka + elasticsearch 实现日志监控 https://blog.csdn.net/github_39939645/article/details/788 ...
- 【iOS】7.4 定位服务->2.1.3.3 定位 - 官方框架CoreLocation 功能3:区域监听
本文并非最终版本,如果想要关注更新或更正的内容请关注文集,联系方式详见文末,如有疏忽和遗漏,欢迎指正. 本文相关目录: ================== 所属文集:[iOS]07 设备工具 === ...
- 【Android】第18章 位置服务和手机定位—本章示例主界面
分类:C#.Android.VS2015: 创建日期:2016-03-04 一.简介 目前,基于位置的服务发展迅速,已涉及到商务.医疗.定位.追踪.敏感区域警告.工作和生活等各个方面.定位服务融合了G ...
- SpringCloud学习(3)——Eureka服务注册中心及服务发现
Eureka概述: Eureka是Netflix的一个子模块, 也是核心模块之一.Eureka是一个基于REST的服务, 用于定位服务, 以实现云端中间层服务发现和故障转移.服务注册与发现对于微服务框 ...
- Linux服务管理(Ubuntu服务管理工具sysv-rc-conf)(转)
Linux运行级别 Linux系统任何时候都运行在一个指定的运行级上,并且不同的运行级的程序和服务都不同,所要完成的工作和要达到的目的都不同,系统可以在这些运行级之间进行切换,以完成不同的工作. 运行 ...
- 微服务Consul系列之服务注册与服务发现
在进行服务注册之前先确认集群是否建立,关于服务注册可以看上篇微服务Consul系列之集群搭建的介绍,两种注册方式:一种是注册HTTP API.另一种是通过配置文件定义,下面讲解的是基于后者配置文件定义 ...
随机推荐
- 菜鸟学IT之分布式文件系统
作业来源:https://edu.cnblogs.com/campus/gzcc/GZCC-16SE1/homework/3310 1.目录操作 在HDFS中为hadoop用户创建一个用户目录(had ...
- 安装EOS合约工具eosio.cdt
安装: 安装完之后 会产生 eosio-cpp_, eosio-cc, eosio-ld, eosio-pp, and _eosio_abigen (These are the C++ compile ...
- java使用ssh连接Linux并执行命令
方式1:通过设置账号密码和链接地址 maven pom.xml配置: <dependency> <groupId>com.jcraft</groupId ...
- 【WebSocket】WebSocket快速入门
WebSocket介绍 WebSocket 是 HTML5 开始提供的一种在单个 TCP 连接上进行全双工通讯的协议. WebSocket 使得客户端和服务器之间的数据交换变得更加简单,允许服务端主动 ...
- k8s记录-kubectl常用
kubectl create/delete -f xxx.yml kubectl get all -A kubectl get pods -o wide kubectl describe pods p ...
- 【翻译】Flink Table Api & SQL —— Overview
本文翻译自官网:https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/ Flink Table Api & ...
- 带CheckBox美化控件的表格全选
带CheckBox美化控件 <table class="positionTable commonListTable" id="positionTable" ...
- .Net - 线程本地变量(存储)的使用
关于C#多线程的文章,大部分都在讨论线程的开始与停止或者是多线程同步问题.多线程同步就是在不同线程中访问同一个变量或共享资源,众所周知在不使用线程同步的机制下,由于竞争的存在会使某些线程产生脏读或者是 ...
- C/C++ 面试-面向对象的特性
面向对象的三大特性 此文只是简单介绍一下三大特性 详细介绍在: 封装:http://www.cnblogs.com/52why/p/7631381.html 继承:http://www.cnblo ...
- Linux 上安装 appium
在linux 环境下安装需要以下几步:1.安装node.js, 通过 uname -a 命令查看到我的Linux系统位数是64位(备注:x86_64表示64位系统, i686 i386表示32位系 ...