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

相关文章

【Prometheus】PromQL向量匹配实现不同标签的向量数据进行运算

✨✨ 欢迎大家来到景天科技苑✨✨ 🎈🎈 养成好习惯,先赞后看哦~🎈🎈 🏆 作者简介:景天科技苑 🏆《头衔》:大厂架构师,华为云开发者社区专家博主,阿里云开发者社区专家博主,CSDN全栈领域优质创作者,掘金优秀博主,51CTO博客专家等。 🏆《博客》:Python全栈,前后端开发,小程序开发,人工智能,js逆向,App逆向,网络系统安全,数据分析,Django,fastapi

业务中14个需要进行A/B测试的时刻[信息图]

在本指南中,我们将全面了解有关 A/B测试 的所有内容。 我们将介绍不同类型的A/B测试,如何有效地规划和启动测试,如何评估测试是否成功,您应该关注哪些指标,多年来我们发现的常见错误等等。 什么是A/B测试? A/B测试(有时称为“分割测试”)是一种实验类型,其中您创建两种或多种内容变体——如登录页面、电子邮件或广告——并将它们显示给不同的受众群体,以查看哪一种效果最好。 本质上,A/B测

ASIO网络调试助手之一:简介

多年前,写过几篇《Boost.Asio C++网络编程》的学习文章,一直没机会实践。最近项目中用到了Asio,于是抽空写了个网络调试助手。 开发环境: Win10 Qt5.12.6 + Asio(standalone) + spdlog 支持协议: UDP + TCP Client + TCP Server 独立的Asio(http://www.think-async.com)只包含了头文件,不依

如何在Visual Studio中调试.NET源码

今天偶然在看别人代码时,发现在他的代码里使用了Any判断List<T>是否为空。 我一般的做法是先判断是否为null,再判断Count。 看了一下Count的源码如下: 1 [__DynamicallyInvokable]2 public int Count3 {4 [__DynamicallyInvokable]5 get

计算机毕业设计 大学志愿填报系统 Java+SpringBoot+Vue 前后端分离 文档报告 代码讲解 安装调试

🍊作者:计算机编程-吉哥 🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。 🍊心愿:点赞 👍 收藏 ⭐评论 📝 🍅 文末获取源码联系 👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~Java毕业设计项目~热门选题推荐《1000套》 目录 1.技术选型 2.开发工具 3.功能

vscode中文乱码问题,注释,终端,调试乱码一劳永逸版

忘记咋回事突然出现了乱码问题,很多方法都试了,注释乱码解决了,终端又乱码,调试窗口也乱码,最后经过本人不懈努力,终于全部解决了,现在分享给大家我的方法。 乱码的原因是各个地方用的编码格式不统一,所以把他们设成统一的utf8. 1.电脑的编码格式 开始-设置-时间和语言-语言和区域 管理语言设置-更改系统区域设置-勾选Bata版:使用utf8-确定-然后按指示重启 2.vscode

遮罩,在指定元素上进行遮罩

废话不多说,直接上代码: ps:依赖 jquer.js 1.首先,定义一个 Overlay.js  代码如下: /*遮罩 Overlay js 对象*/function Overlay(options){//{targetId:'',viewHtml:'',viewWidth:'',viewHeight:''}try{this.state=false;//遮罩状态 true 激活,f

利用matlab bar函数绘制较为复杂的柱状图,并在图中进行适当标注

示例代码和结果如下:小疑问:如何自动选择合适的坐标位置对柱状图的数值大小进行标注?😂 clear; close all;x = 1:3;aa=[28.6321521955954 26.2453660695847 21.69102348512086.93747104431360 6.25442246899816 3.342835958564245.51365061796319 4.87

Python脚本:对文件进行批量重命名

字符替换:批量对文件名中指定字符进行替换添加前缀:批量向原文件名添加前缀添加后缀:批量向原文件名添加后缀 import osdef Rename_CharReplace():#对文件名中某字符进行替换(已完结)re_dir = os.getcwd()re_list = os.listdir(re_dir)original_char = input('请输入你要替换的字符:')replace_ch