如何启用SSHD的调试模式进行调试

2024-04-25 18:32

本文主要是介绍如何启用SSHD的调试模式进行调试,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

如何启用SSHD的调试模式进行调试

    • 1. 服务器启动调试模式
    • 2. 客户端启动调试模式
    • 3. 错误日志

1. 服务器启动调试模式

h-4.2# /usr/sbin/sshd -f /export/Data/cfs/config/sftp/sshd_config -d -p 1234    
debug1: sshd version OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013                                                                                             
debug1: key_parse_private2: missing begin marker                                                                                                                
debug1: read PEM private key done: type RSA                                                                                                                     
debug1: private host key: #0 type 1 RSA                                                                                                                         
debug1: key_parse_private2: missing begin marker                                                                                                                
debug1: read PEM private key done: type DSA                                                                                                                     
debug1: private host key: #1 type 2 DSA                                                                                                                         
debug1: key_parse_private2: missing begin marker                                                                                                                
debug1: read PEM private key done: type ECDSA                                                                                                                   
debug1: private host key: #2 type 3 ECDSA                                                                                                                       
debug1: key_parse_private2: missing begin marker                                                                                                                
debug1: read PEM private key done: type DSA                                                                                                                     
debug1: private host key: #3 type 2 DSA                                                                                                                         
debug1: rexec_argv[0]='/usr/sbin/sshd'                                                                                                                          
debug1: rexec_argv[1]='-f'                                                                                                                                      
debug1: rexec_argv[2]='/export/Data/cfs/config/sftp/sshd_config'                                                                                                
debug1: rexec_argv[3]='-d'                                                                                                                                      
debug1: rexec_argv[4]='-p'                                                                                                                                      
debug1: rexec_argv[5]='1234'                                                                                                                                    
Set /proc/self/oom_score_adj from 993 to -1000                                                                                                                  
debug1: Bind to port 1234 on 0.0.0.0.                                                                                                                           
Server listening on 0.0.0.0 port 1234.                                                                                                                          
debug1: Bind to port 1234 on ::.                                                                                                                                
Server listening on :: port 1234.  

2. 客户端启动调试模式

(base)ZBMAC-9b3ab3c69:~ atang$ ssh -vp 1234 admin@sftp.atang.com
OpenSSH_7.8p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to sftp.atang.com port 1234.
debug1: Connection established.
debug1: identity file /Users/atang/.ssh/id_rsa type 0
debug1: identity file /Users/atang/.ssh/id_rsa-cert type -1
debug1: identity file /Users/atang/.ssh/id_dsa type -1
debug1: identity file /Users/atang/.ssh/id_dsa-cert type -1
debug1: identity file /Users/atang/.ssh/id_ecdsa type -1
debug1: identity file /Users/atang/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/atang/.ssh/id_ed25519 type -1
debug1: identity file /Users/atang/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/atang/.ssh/id_xmss type -1
debug1: identity file /Users/atang/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000002
debug1: Authenticating to sftp.atang.com:1234 as 'admin'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:7bCNuDdmBkwku+6OpEI8iP6pOXJnbycC6Ph/ECF7Qmw
debug1: checking without port identifier
debug1: Host 'sftp.atang.com' is known and matches the ECDSA host key.
debug1: Found key in /Users/atang/.ssh/known_hosts:18
debug1: found matching key w/out port
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:id6ElUY61qnp8efjKl5ifvYebqLbi8bASv8z88UQEIk /Users/atang/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: /Users/atang/.ssh/id_dsa
debug1: Trying private key: /Users/atang/.ssh/id_ecdsa
debug1: Trying private key: /Users/atang/.ssh/id_ed25519
debug1: Trying private key: /Users/atang/.ssh/id_xmss
debug1: No more authentication methods to try.
admin@sftp.atang.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

3. 错误日志

启动后server端日志信息

debug1: Server will not fork when running in debugging mode.                                                                                                    
debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8                                                                                                         
debug1: inetd sockets after dupping: 3, 3                                                                                                                       
Connection from 172.22.141.3 port 2051 on 11.80.25.166 port 1234                                                                                                
debug1: Client protocol version 2.0; client software version OpenSSH_7.8                                                                                        
debug1: match: OpenSSH_7.8 pat OpenSSH* compat 0x04000000                                                                                                       
debug1: Enabling compatibility mode for protocol 2.0                                                                                                            
debug1: Local version string SSH-2.0-OpenSSH_6.6.1                                                                                                              
debug1: SELinux support disabled [preauth]                                                                                                                      
debug1: permanently_set_uid: 74/74 [preauth]                                                                                                                    
debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-dss [preauth]                                                                               
debug1: SSH2_MSG_KEXINIT sent [preauth]                                                                                                                         
debug1: SSH2_MSG_KEXINIT received [preauth]                                                                                                                     
debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none [preauth]                                                                             
debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none [preauth]                                                                             
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64 [preauth]                                                                                          
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64 [preauth]                                                                                          
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]                                                                                                              
debug1: SSH2_MSG_NEWKEYS sent [preauth]                                                                                                                         
debug1: expecting SSH2_MSG_NEWKEYS [preauth]                                                                                                                    
debug1: SSH2_MSG_NEWKEYS received [preauth]                                                                                                                     
debug1: KEX done [preauth]                                                                                                                                      
debug1: userauth-request for user admin service ssh-connection method none [preauth]                                                                            
debug1: attempt 0 failures 0 [preauth]                                                                                                                          
debug1: PAM: initializing for "admin"                                                                                                                           
debug1: PAM: setting PAM_RHOST to "172.22.141.3"                                                                                                                
debug1: PAM: setting PAM_TTY to "ssh"                                                                                                                           
debug1: userauth-request for user admin service ssh-connection method publickey [preauth]                                                                       
debug1: attempt 1 failures 0 [preauth]                                                                                                                          
debug1: test whether pkalg/pkblob are acceptable [preauth]                                                                                                      
debug1: temporarily_use_uid: 600/600 (e=0/0)                                                                                                                    
debug1: trying public key file /home/admin/.ssh/authorized_keys                                                                                                 
debug1: Could not open authorized keys '/home/admin/.ssh/authorized_keys': No such file or directory                                                            
debug1: restore_uid: 0/0                                                                                                                                        
debug1: temporarily_use_uid: 600/600 (e=0/0)                                                                                                                    
debug1: trying public key file /home/admin/.ssh/authorized_keys2                                                                                                
debug1: Could not open authorized keys '/home/admin/.ssh/authorized_keys2': No such file or directory                                                           
debug1: restore_uid: 0/0                                                                                                                                        
Failed publickey for admin from 172.22.141.3 port 2051 ssh2: RSA 83:ae:3a:71:c5:1e:02:92:10:a2:ac:9f:d8:3d:20:87                                                
Connection closed by 172.22.141.3 [preauth]                                                                                                                     
debug1: do_cleanup [preauth]                                                                                                                                    
debug1: monitor_read_log: child log fd closed                                                                                                                   
debug1: do_cleanup                                                                                                                                              
debug1: PAM: cleanup                                                                                                                                            
debug1: Killing privsep child 117295                                                                                                                              

这篇关于如何启用SSHD的调试模式进行调试的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/935461

相关文章

Java服务实现开启Debug远程调试

《Java服务实现开启Debug远程调试》文章介绍如何通过JVM参数开启Java服务远程调试,便于在线上排查问题,在IDEA中配置客户端连接,实现无需频繁部署的调试,提升效率... 目录一、背景二、相关图示说明三、具体操作步骤1、服务端配置2、客户端配置总结一、背景日常项目中,通常我们的代码都是部署到远程

Python进行word模板内容替换的实现示例

《Python进行word模板内容替换的实现示例》本文介绍了使用Python自动化处理Word模板文档的常用方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友... 目录技术背景与需求场景核心工具库介绍1.获取你的word模板内容2.正常文本内容的替换3.表格内容的

Git进行版本控制的实战指南

《Git进行版本控制的实战指南》Git是一种分布式版本控制系统,广泛应用于软件开发中,它可以记录和管理项目的历史修改,并支持多人协作开发,通过Git,开发者可以轻松地跟踪代码变更、合并分支、回退版本等... 目录一、Git核心概念解析二、环境搭建与配置1. 安装Git(Windows示例)2. 基础配置(必

JavaScript中的高级调试方法全攻略指南

《JavaScript中的高级调试方法全攻略指南》什么是高级JavaScript调试技巧,它比console.log有何优势,如何使用断点调试定位问题,通过本文,我们将深入解答这些问题,带您从理论到实... 目录观点与案例结合观点1观点2观点3观点4观点5高级调试技巧详解实战案例断点调试:定位变量错误性能分

Nginx中配置使用非默认80端口进行服务的完整指南

《Nginx中配置使用非默认80端口进行服务的完整指南》在实际生产环境中,我们经常需要将Nginx配置在其他端口上运行,本文将详细介绍如何在Nginx中配置使用非默认端口进行服务,希望对大家有所帮助... 目录一、为什么需要使用非默认端口二、配置Nginx使用非默认端口的基本方法2.1 修改listen指令

MySQL按时间维度对亿级数据表进行平滑分表

《MySQL按时间维度对亿级数据表进行平滑分表》本文将以一个真实的4亿数据表分表案例为基础,详细介绍如何在不影响线上业务的情况下,完成按时间维度分表的完整过程,感兴趣的小伙伴可以了解一下... 目录引言一、为什么我们需要分表1.1 单表数据量过大的问题1.2 分表方案选型二、分表前的准备工作2.1 数据评估

MySQL进行分片合并的实现步骤

《MySQL进行分片合并的实现步骤》分片合并是指在分布式数据库系统中,将不同分片上的查询结果进行整合,以获得完整的查询结果,下面就来具体介绍一下,感兴趣的可以了解一下... 目录环境准备项目依赖数据源配置分片上下文分片查询和合并代码实现1. 查询单条记录2. 跨分片查询和合并测试结论分片合并(Shardin

Go语言网络故障诊断与调试技巧

《Go语言网络故障诊断与调试技巧》在分布式系统和微服务架构的浪潮中,网络编程成为系统性能和可靠性的核心支柱,从高并发的API服务到实时通信应用,网络的稳定性直接影响用户体验,本文面向熟悉Go基本语法和... 目录1. 引言2. Go 语言网络编程的优势与特色2.1 简洁高效的标准库2.2 强大的并发模型2.

SpringBoot结合Knife4j进行API分组授权管理配置详解

《SpringBoot结合Knife4j进行API分组授权管理配置详解》在现代的微服务架构中,API文档和授权管理是不可或缺的一部分,本文将介绍如何在SpringBoot应用中集成Knife4j,并进... 目录环境准备配置 Swagger配置 Swagger OpenAPI自定义 Swagger UI 底

基于Python Playwright进行前端性能测试的脚本实现

《基于PythonPlaywright进行前端性能测试的脚本实现》在当今Web应用开发中,性能优化是提升用户体验的关键因素之一,本文将介绍如何使用Playwright构建一个自动化性能测试工具,希望... 目录引言工具概述整体架构核心实现解析1. 浏览器初始化2. 性能数据收集3. 资源分析4. 关键性能指