SSH gets hung

Latest response

Sometimes in one of our server the ssh gets hung for one particular id alone and if we remove out the /tmp/ssh- directory it is again working fine. Any possible reasons and solutions for this.

Responses

Normally, ssh users keys and login environment details gets stored under .ssh directory inside users home. So, what is there within /tmp/ssh directory? Is this directory getting created automatically upon user ssh login?

Are you using hostname or IP address to login? If login using ip address works faster than hostname then it could be due to "UseDNS" inside sshd.conf file which you can set it to "no", restart sshd service and test the connectivity. This may prompt for confirmation while logging in since there is change in key fingerprint, after successful login those details would get added to ~./.ssh/known_hosts file.

But it is better to initially run the ssh command in verbose mode to see where exactly it is getting delayed, using the syntax format as : ssh -vvv @

Also, let us know what version of RHEL is this? It is good if you could also get this command output run on server:

egrep -v "^$|^#" /etc/ssh/sshd_config

These /tmp/ssh-* directories are from ssh-agent(1). Are these directories removed when the corresponding agent terminates?

@Sadhashiva. There is not such file or directory. OS version is RHEL 6.8. We connect using hostname.

[Prod root @ fbblnxswai09p ~]

ls -ld /etc/ssh/sshd_config

ls: cannot access /etc/ssh/sshd_config: No such file or directory [Prod root @ fbblnxswai09p ~]

@Siem, they do not get cleared out automatically. There will be around 50000 successful connections from this particular source to the destination. When this gets hung we have to manually remove the directory /tmp/ssh-id. Since the ssh needs to be continuously running and there is no other id getting issues due to this and it is only this particular id we are having issue with.

This file '/etc/ssh/sshd_config' gets created by "openssh-server" package and without this how could the sshd daemon be running? Are you not using native 'openssh-server' package ? Is /tmp mounted separately from root, if so, I hope the file system usage is not full or nearly full?, ...

ssh-agent is a client program. This system is used as source to ssh to a destination system running sshd.

That is correct. I was wondering why I am seeing this issue only for this particular id and not the other ids in the server.

Please elaborate about the ssh usage of the users. You mentioned 50.000 connections. Are they equally used by all users? You also indicated that ssh needs to be running continuously. Is that a single connection or are the users continuously starting new connections?

@Sadhashiva, we are using SSHtectia and not openssh. The filesystem is not full.

It is only one user who connects to the secondary node part of the two node Veritas cluster to access shared filesystems used for abinitio. The connections will be newly started frequently.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.