首页 > 其他分享 >SSH登录

SSH登录

时间:2023-08-07 20:33:12浏览次数:40  
标签:debug1 file 登录 cscroot SSH key home ssh

近期经常遇到ssh登录问题,不是卡顿就是拒绝,还有无法登录认证问题(新建用户可以登录,或权限太大无法登录)等,搞得焦头烂额,以下汇总整理,并继续更新中。

先看下正常登录详情:

[monitor00@~]$ssh -v [email protected]
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to 172.16.19.23 [172.16.19.23] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/cscroot/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/cscroot/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/cscroot/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/cscroot/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/cscroot/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/cscroot/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/cscroot/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/cscroot/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
debug1: Authenticating to 172.16.19.23:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: [email protected] compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: [email protected] compression: none
debug1: kex: diffie-hellman-group-exchange-sha256 need=16 dh_need=16
debug1: kex: diffie-hellman-group-exchange-sha256 need=16 dh_need=16
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:oR73znvjJ110Pjr8R99K3QeIAHqovMOX0FZGTrhdn9o
debug1: Host '172.16.19.23' is known and matches the RSA host key.
debug1: Found key in /home/cscroot/.ssh/known_hosts:517
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
'debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: KEYRING:persistent:1000)

debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: KEYRING:persistent:1000)
'
debug1: Next authentication method: publickey
debug1: Trying private key: /home/cscroot/.ssh/id_rsa
debug1: Trying private key: /home/cscroot/.ssh/id_dsa
debug1: Trying private key: /home/cscroot/.ssh/id_ecdsa
debug1: Trying private key: /home/cscroot/.ssh/id_ed25519
debug1: Next authentication method: password
[email protected]'s password: 
debug1: Authentication succeeded (password).
Authenticated to 172.16.19.23 ([172.16.19.23]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Last login: Wed Aug  2 10:04:49 2023 from 172.16.19.73

1、ssh登录过程中卡,或输入密码后无反应

首先排除掉网络问题,可以通过ping看看是否存在高延迟,建议在内网同网段地址间测试,因同网段内延迟都小于1;

SSH登录_ssh登录

其次测试ssh服务端口处于监听状态,可以通过telnet命令测试,观察是否卡;

SSH登录_ssh登录_02

再次

2、拒绝登录

3、权限太大无法登录

4、输入密码后快速回退到重新登录界面


标签:debug1,file,登录,cscroot,SSH,key,home,ssh
From: https://blog.51cto.com/chier11/6997266

相关文章

  • Linux之SSH
    目录一、SSH概述1.1SSH基础1.1.1SSH概述1.1.2SSH优点1.1.3SSH功能1.2SSH原理1.3SSH服务端二、免密登录一、SSH概述1.1SSH基础1.1.1SSH概述SSH(SecureShell)是一种安全通道协议,主要用来实现字符界面的远程登录、远程复制等功能。SSH协议对通信双方的数据传输进行了加密处理,其......
  • Linux网络服务之SSH服务
    目录SSH服务1.ssh基础2.ssh原理3.实际操作SSH服务1.ssh基础SSH(SecureShell)协议是一种安全通道协议对通信数据进行了加密处理,用于远程管理作用:主要用来实现字符界面的远程登录、远程复制等功能。SSH协议对通信双方的数据传输进行了加密处理,其中包括用户登录时输入的......
  • SSH免密登录实操
    实现免密登录流程生成密钥文件key后是密钥默认生成的文件位置无需改文件位置便进行三次回车,生成密钥 查看文件 将公钥文件发送给你想免密登录的主机 之后连接不再需要密码 ......
  • SSH
    一.SSH服务1)SSH服务的概念和优点SSH(SecureShell)是一种安全通道协议,主要用来实现字符界面的远程登录、远程复制等功能。SSH协议对通信双方的数据传输进行了加密处理,其中包括用户登录时输入的用户口令,SSH为建立在应用层和传输层基础上的安全协议。对数据进行压缩,加快传输速......
  • Django多方式登录认证
    多方式认证原理我们平常使用的Django登录认证是django.contrib.auth.authenticate点进去源码,我们会看到这个函数,真正的认证类是它里面的那个继续点进去源码,会看到ModelBacked类,内部是用户名登录认证校验,它上一层就是基类了,所以我们只要重写这个类的authenticate函数即可。......
  • ssh 通过跳板机登陆远程服务器
    开心一刻    “老师,你认识元芳吗?”    “不”    “你认识程祖吗?”    “不”    “那你知道他们的姐是谁吗?”    “不”    “老师你都不知道,我怎么知道:原方程组的解是______?”    “……”写在前面   ......
  • jenkins 远程 ssh 部署问题记录
    脚本执行失败注意需要在sh脚本里面添加source/etc/profile脚本执行失败排查可以在jenkins的ssh命令添加日志,然后查看日志排错nohupsh/xx/xx.sh>/xx/xx.log2>&1&脚本编写注意事项在脚本开头添加cd到当前目录,确保脚本内部读取的路径正常......
  • SSH原理与实践(三)安装和使用
    主页个人微信公众号:密码应用技术实战个人博客园首页:https://www.cnblogs.com/informatics/引言在之前SSH原理与实践系列文章中,我们主要讲解了SSH协议的原理部分。作为该系列文章的最后一篇,本文将对SSH实践部分进行介绍。好文回顾......
  • Linux系统服务器启动SSH服务时出现“error while loading shared libraries”错误该如
    问题描述本文主要介绍在Linux系统服务器启动SSH服务时,命令行或secure日志文件出现类似如下的错误信息。· errorwhileloadingsharedlibraries:libcrypto.so.10:cannotopensharedobjectfile:Nosuchfileordirectory.· PAMunabletodlopen(/usr/lib64/security/pam......
  • springboot+mysql简单的登录系统
    springboot+mysql简单的登录系统pom.xml<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation=&q......