SSH Terminal Hang on certain commands

New to Debian (Or Linux in general)? Ask your questions here!

SSH Terminal Hang on certain commands

Postby Amrod » 2017-10-07 14:16

Hi everyone,

i'm experiencing a strange issue, never happened before and only on 2 server over 100.. Maybe someone can point me in right direction.

basicly when i'm logged remotely with SSH output from certain commands will randomly hangs: always happen with cat or ls
nevermind if i try ls -la into a huge dir or with a dir with only few files... it hangs.
Same if i try to cat a file (small or big): it show me only few lines then hangs.

Note that if i work into console, there' s no problem, everything works perfectly.

System is a Debian Jessie, clean system with only ssh, apache and nothing more. Tried to reset and clear session, nothing. Reboot many times, nothing change.
Over Google seem sometimes this issue show with a remote filesystem mounted or not mounted correctly, but there's no nfs , iscsi , cdrom or other here..

Anyone got ideas to spare ??

many thanks

mauro
Amrod
 
Posts: 3
Joined: 2017-10-07 14:07

Re: SSH Terminal Hang on certain commands

Postby GarryRicketson » 2017-10-07 14:44

Code: Select all
man ssh

-v Verbose mode. Causes ssh to print debugging messages about its
progress. This is helpful in debugging connection,
authentication, and configuration problems. Multiple -v options
increase the verbosity. The maximum is 3.


Code: Select all
ssh -v me@mysshaddress

Use your ssh address , not "me@mysshaddress" and the -v option
might show something.
"What we expect you have already Done"

Before doing anything, read the Debian documentation:
Debian Documentation
How to ask the smart way
Debian Foro Español
======================
For the Birds
User avatar
GarryRicketson
 
Posts: 4440
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: SSH Terminal Hang on certain commands

Postby Amrod » 2017-10-08 07:52

thanks for your answer. Why you think is a SSH problem ? connection via SSH works like a charm, and if i not use command
that print terminal output, there's no problem.

Verbose show nothing strange into SSH connection. This is a screenshot of problem..

Image
Amrod
 
Posts: 3
Joined: 2017-10-07 14:07

Re: SSH Terminal Hang on certain commands

Postby debiman » 2017-10-08 08:10

the screenshot tells us nothing.
and why waste so much bandwidth for something that could have been copy-pasted?

please, more information about the affected machines, the operating systems and versions used on both client and server etc. etc.

and also what garryricketson asked.

of coursethe problem is ssh related, as you yourself stated.
User avatar
debiman
 
Posts: 1619
Joined: 2013-03-12 07:18

Re: SSH Terminal Hang on certain commands

Postby Amrod » 2017-10-10 13:47

OS version

Code: Select all
root@nd31:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"


Code: Select all
root@nd31:~# uname -a
Linux nd31 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux


SSH connection :

Code: Select all
[root@nd16 ~]# ssh -v root@192.168.2.64
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.2.64 [192.168.2.64] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/identity-cert type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Debian-5+deb8u3
debug1: match: OpenSSH_6.7p1 Debian-5+deb8u3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '192.168.2.64' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Next authentication method: password
root@192.168.2.64's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Oct 10 16:28:14 2017 from 192.168.100.32
root@nd31:~#


about SSH client, i tried from centos, debian many version, from Putty and Cygwin into Windows.. always the same.

Many thanks.
Amrod
 
Posts: 3
Joined: 2017-10-07 14:07

Re: SSH Terminal Hang on certain commands

Postby debiman » 2017-10-10 14:53

so it happens on all clients on what, 4 different operating systems? are these all baremetal installs (i.e. no virtual machines)?

unfortunately i see nothing that would indicate why certain commands would hang, but don't take my word on it.
could be a network bottleneck on either side?
client or server machine running near 100% resources (cpu, ram etc)?
if it's always cat or ls, that also might point to a filesystem issue.

what i do see, with 100% clarity, is this:
client as root, tries to ssh into the root account.
both is really, really wrong.
you should use ssh as an unprivileged user, and ssh into an unprivileged user.
from there you can still su to root or sudo.
User avatar
debiman
 
Posts: 1619
Joined: 2013-03-12 07:18

Re: SSH Terminal Hang on certain commands

Postby TonyT » 2017-10-18 20:04

i'm experiencing a strange issue, never happened before and only on 2 server over 100.. Maybe someone can point me in right direction.

To start, check the logs on those 2 servers.
They may reveal what you need to know.
Also, could be hardware related on those 2 machines, e.g. drives on the way out, bad ram, etc.
TonyT
 
Posts: 525
Joined: 2006-09-04 11:57


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable