如何启用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

相关文章

Pandas使用AdaBoost进行分类的实现

《Pandas使用AdaBoost进行分类的实现》Pandas和AdaBoost分类算法,可以高效地进行数据预处理和分类任务,本文主要介绍了Pandas使用AdaBoost进行分类的实现,具有一定的参... 目录什么是 AdaBoost?使用 AdaBoost 的步骤安装必要的库步骤一:数据准备步骤二:模型

使用Pandas进行均值填充的实现

《使用Pandas进行均值填充的实现》缺失数据(NaN值)是一个常见的问题,我们可以通过多种方法来处理缺失数据,其中一种常用的方法是均值填充,本文主要介绍了使用Pandas进行均值填充的实现,感兴趣的... 目录什么是均值填充?为什么选择均值填充?均值填充的步骤实际代码示例总结在数据分析和处理过程中,缺失数

利用Python调试串口的示例代码

《利用Python调试串口的示例代码》在嵌入式开发、物联网设备调试过程中,串口通信是最基础的调试手段本文将带你用Python+ttkbootstrap打造一款高颜值、多功能的串口调试助手,需要的可以了... 目录概述:为什么需要专业的串口调试工具项目架构设计1.1 技术栈选型1.2 关键类说明1.3 线程模

QT进行CSV文件初始化与读写操作

《QT进行CSV文件初始化与读写操作》这篇文章主要为大家详细介绍了在QT环境中如何进行CSV文件的初始化、写入和读取操作,本文为大家整理了相关的操作的多种方法,希望对大家有所帮助... 目录前言一、CSV文件初始化二、CSV写入三、CSV读取四、QT 逐行读取csv文件五、Qt如何将数据保存成CSV文件前言

通过Spring层面进行事务回滚的实现

《通过Spring层面进行事务回滚的实现》本文主要介绍了通过Spring层面进行事务回滚的实现,包括声明式事务和编程式事务,具有一定的参考价值,感兴趣的可以了解一下... 目录声明式事务回滚:1. 基础注解配置2. 指定回滚异常类型3. ​不回滚特殊场景编程式事务回滚:1. ​使用 TransactionT

Java中使用Hutool进行AES加密解密的方法举例

《Java中使用Hutool进行AES加密解密的方法举例》AES是一种对称加密,所谓对称加密就是加密与解密使用的秘钥是一个,下面:本文主要介绍Java中使用Hutool进行AES加密解密的相关资料... 目录前言一、Hutool简介与引入1.1 Hutool简介1.2 引入Hutool二、AES加密解密基础

SpringSecurity6.0 如何通过JWTtoken进行认证授权

《SpringSecurity6.0如何通过JWTtoken进行认证授权》:本文主要介绍SpringSecurity6.0通过JWTtoken进行认证授权的过程,本文给大家介绍的非常详细,感兴趣... 目录项目依赖认证UserDetailService生成JWT token权限控制小结之前写过一个文章,从S

使用Python自建轻量级的HTTP调试工具

《使用Python自建轻量级的HTTP调试工具》这篇文章主要为大家详细介绍了如何使用Python自建一个轻量级的HTTP调试工具,文中的示例代码讲解详细,感兴趣的小伙伴可以参考一下... 目录一、为什么需要自建工具二、核心功能设计三、技术选型四、分步实现五、进阶优化技巧六、使用示例七、性能对比八、扩展方向建

使用Jackson进行JSON生成与解析的新手指南

《使用Jackson进行JSON生成与解析的新手指南》这篇文章主要为大家详细介绍了如何使用Jackson进行JSON生成与解析处理,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录1. 核心依赖2. 基础用法2.1 对象转 jsON(序列化)2.2 JSON 转对象(反序列化)3.

C#使用SQLite进行大数据量高效处理的代码示例

《C#使用SQLite进行大数据量高效处理的代码示例》在软件开发中,高效处理大数据量是一个常见且具有挑战性的任务,SQLite因其零配置、嵌入式、跨平台的特性,成为许多开发者的首选数据库,本文将深入探... 目录前言准备工作数据实体核心技术批量插入:从乌龟到猎豹的蜕变分页查询:加载百万数据异步处理:拒绝界面