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

相关文章

使用MongoDB进行数据存储的操作流程

《使用MongoDB进行数据存储的操作流程》在现代应用开发中,数据存储是一个至关重要的部分,随着数据量的增大和复杂性的增加,传统的关系型数据库有时难以应对高并发和大数据量的处理需求,MongoDB作为... 目录什么是MongoDB?MongoDB的优势使用MongoDB进行数据存储1. 安装MongoDB

Linux使用fdisk进行磁盘的相关操作

《Linux使用fdisk进行磁盘的相关操作》fdisk命令是Linux中用于管理磁盘分区的强大文本实用程序,这篇文章主要为大家详细介绍了如何使用fdisk进行磁盘的相关操作,需要的可以了解下... 目录简介基本语法示例用法列出所有分区查看指定磁盘的区分管理指定的磁盘进入交互式模式创建一个新的分区删除一个存

C#使用HttpClient进行Post请求出现超时问题的解决及优化

《C#使用HttpClient进行Post请求出现超时问题的解决及优化》最近我的控制台程序发现有时候总是出现请求超时等问题,通常好几分钟最多只有3-4个请求,在使用apipost发现并发10个5分钟也... 目录优化结论单例HttpClient连接池耗尽和并发并发异步最终优化后优化结论我直接上优化结论吧,

使用Python进行文件读写操作的基本方法

《使用Python进行文件读写操作的基本方法》今天的内容来介绍Python中进行文件读写操作的方法,这在学习Python时是必不可少的技术点,希望可以帮助到正在学习python的小伙伴,以下是Pyth... 目录一、文件读取:二、文件写入:三、文件追加:四、文件读写的二进制模式:五、使用 json 模块读写

使用zabbix进行监控网络设备流量

《使用zabbix进行监控网络设备流量》这篇文章主要为大家详细介绍了如何使用zabbix进行监控网络设备流量,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录安装zabbix配置ENSP环境配置zabbix实行监控交换机测试一台liunx服务器,这里使用的为Ubuntu22.04(

C++中实现调试日志输出

《C++中实现调试日志输出》在C++编程中,调试日志对于定位问题和优化代码至关重要,本文将介绍几种常用的调试日志输出方法,并教你如何在日志中添加时间戳,希望对大家有所帮助... 目录1. 使用 #ifdef _DEBUG 宏2. 加入时间戳:精确到毫秒3.Windows 和 MFC 中的调试日志方法MFC

在Pandas中进行数据重命名的方法示例

《在Pandas中进行数据重命名的方法示例》Pandas作为Python中最流行的数据处理库,提供了强大的数据操作功能,其中数据重命名是常见且基础的操作之一,本文将通过简洁明了的讲解和丰富的代码示例,... 目录一、引言二、Pandas rename方法简介三、列名重命名3.1 使用字典进行列名重命名3.编

python安装完成后可以进行的后续步骤和注意事项小结

《python安装完成后可以进行的后续步骤和注意事项小结》本文详细介绍了安装Python3后的后续步骤,包括验证安装、配置环境、安装包、创建和运行脚本,以及使用虚拟环境,还强调了注意事项,如系统更新、... 目录验证安装配置环境(可选)安装python包创建和运行Python脚本虚拟环境(可选)注意事项安装

如何使用celery进行异步处理和定时任务(django)

《如何使用celery进行异步处理和定时任务(django)》文章介绍了Celery的基本概念、安装方法、如何使用Celery进行异步任务处理以及如何设置定时任务,通过Celery,可以在Web应用中... 目录一、celery的作用二、安装celery三、使用celery 异步执行任务四、使用celery

SpringBoot使用minio进行文件管理的流程步骤

《SpringBoot使用minio进行文件管理的流程步骤》MinIO是一个高性能的对象存储系统,兼容AmazonS3API,该软件设计用于处理非结构化数据,如图片、视频、日志文件以及备份数据等,本文... 目录一、拉取minio镜像二、创建配置文件和上传文件的目录三、启动容器四、浏览器登录 minio五、