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

相关文章

Golang如何对cron进行二次封装实现指定时间执行定时任务

《Golang如何对cron进行二次封装实现指定时间执行定时任务》:本文主要介绍Golang如何对cron进行二次封装实现指定时间执行定时任务问题,具有很好的参考价值,希望对大家有所帮助,如有错误... 目录背景cron库下载代码示例【1】结构体定义【2】定时任务开启【3】使用示例【4】控制台输出总结背景

使用Python进行GRPC和Dubbo协议的高级测试

《使用Python进行GRPC和Dubbo协议的高级测试》GRPC(GoogleRemoteProcedureCall)是一种高性能、开源的远程过程调用(RPC)框架,Dubbo是一种高性能的分布式服... 目录01 GRPC测试安装gRPC编写.proto文件实现服务02 Dubbo测试1. 安装Dubb

Linux使用scp进行远程目录文件复制的详细步骤和示例

《Linux使用scp进行远程目录文件复制的详细步骤和示例》在Linux系统中,scp(安全复制协议)是一个使用SSH(安全外壳协议)进行文件和目录安全传输的命令,它允许在远程主机之间复制文件和目录,... 目录1. 什么是scp?2. 语法3. 示例示例 1: 复制本地目录到远程主机示例 2: 复制远程主

IDEA如何实现远程断点调试jar包

《IDEA如何实现远程断点调试jar包》:本文主要介绍IDEA如何实现远程断点调试jar包的问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录问题步骤总结问题以jar包的形式运行Spring Boot项目时报错,但是在IDEA开发环境javascript下编译

windows系统上如何进行maven安装和配置方式

《windows系统上如何进行maven安装和配置方式》:本文主要介绍windows系统上如何进行maven安装和配置方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不... 目录1. Maven 简介2. maven的下载与安装2.1 下载 Maven2.2 Maven安装2.

C/C++的OpenCV 进行图像梯度提取的几种实现

《C/C++的OpenCV进行图像梯度提取的几种实现》本文主要介绍了C/C++的OpenCV进行图像梯度提取的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的... 目录预www.chinasem.cn备知识1. 图像加载与预处理2. Sobel 算子计算 X 和 Y

Go语言中使用JWT进行身份验证的几种方式

《Go语言中使用JWT进行身份验证的几种方式》本文主要介绍了Go语言中使用JWT进行身份验证的几种方式,包括dgrijalva/jwt-go、golang-jwt/jwt、lestrrat-go/jw... 目录简介1. github.com/dgrijalva/jwt-go安装:使用示例:解释:2. gi

SpringBoot如何对密码等敏感信息进行脱敏处理

《SpringBoot如何对密码等敏感信息进行脱敏处理》这篇文章主要为大家详细介绍了SpringBoot对密码等敏感信息进行脱敏处理的几个常用方法,文中的示例代码讲解详细,感兴趣的小伙伴可以了解下... 目录​1. 配置文件敏感信息脱敏​​2. 日志脱敏​​3. API响应脱敏​​4. 其他注意事项​​总结

python进行while遍历的常见错误解析

《python进行while遍历的常见错误解析》在Python中选择合适的遍历方式需要综合考虑可读性、性能和具体需求,本文就来和大家讲解一下python中while遍历常见错误以及所有遍历方法的优缺点... 目录一、超出数组范围问题分析错误复现解决方法关键区别二、continue使用问题分析正确写法关键点三

Python对PDF书签进行添加,修改提取和删除操作

《Python对PDF书签进行添加,修改提取和删除操作》PDF书签是PDF文件中的导航工具,通常包含一个标题和一个跳转位置,本教程将详细介绍如何使用Python对PDF文件中的书签进行操作... 目录简介使用工具python 向 PDF 添加书签添加书签添加嵌套书签Python 修改 PDF 书签Pytho