ssh login exception

Scenario description: A
development colleague reported that a common user test could not log in to a computer remotely, and the error "shell request failed on channel 0" was reported.
solution process
mark

  • Determine whether the memory space is sufficient
  • Check whether the user exists (excluding the possibility of deleting the user by mistake)
  • View the public key file (authorized_kys), ssh configuration file (.ssh/config) and custom public key file (id_rsa_gitlab_deploy)
  • Use w to view the current terminal online users
  • "lsof /dev/pts/*" to see which processes are occupied by file descriptors in the current server
  • Use sudo su test to try to log in to the server, and an error is reported: "su: failed to execute /bin/bash: The resource is temporarily unavailable" ==> It is probably located as insufficient FD resources
  • Execute the lsof command to list the tools that open files in the current system, and display the status of the process at the same time. At this time, it is found that there are many close_wait processes
  • Further confirmation, for the code problem, inform the relevant developers
  • Kill the process (non-online important process, communicate with the development before killing), and the developer will start it after repairing it.

2018/02/26
Today, ssh to another linux machine failed while doing jenkins! The error is as follows

[root@Dasoncheng ~]# ssh [email protected]
[email protected]'s password:
##我已经把公钥放在服务端了,还是让我输入密码;我就重启了一下服务端 结果:
[root@Dasoncheng ~]# ssh [email protected]
ssh_exchange_identification: read: Connection reset by peer
##等待了一会 结果报上面的错误。我就百度了

Solution:

[root@Dasoncheng2 var]# cd /var/
[root@Dasoncheng2 var]# chmod -R 755 *
继续百度,又跑到一个歪果仁的网站上,在一个不起眼论坛的一个不起眼的帖子中一个不起眼的跟帖中,一个哥们很低调的说了句“I know this quesiton is old ,
but I wanted to share some findings I had,Check if /var/empty/sshd on the server has appropriate ownership and permissions.
We had a chef script that was modifile toupdate some directory peimisions,but indavertently updated the diectory below the 
intended target,chaning ownership of /var to an applicaton user/group and changing the permissons to 755."
去/var下看了看,果然权限很大,都是777,cd 到 empty 目录,果然有ssh这个文件夹,在cd进去,啥也没有了。于是直接执行两条命令: 
cd /var 
chmod -R 755 * 
然后就再次尝试了远程连接了下,竟然ok了。

mark
Original link: http://blog.csdn.net/x6_9x/article/details/49983607
A very good ssh login failure troubleshooting experience: https://www.cnblogs.com/starof/p/4709805.html


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325076438&siteId=291194637