You are not logged in.

#1 2015-09-03 14:51:09

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

SSH Hangs

I am trying to connect to my remote server via ssh. I use this line:

$ ssh compsci@10.1.1.12

After that ssh just sits there and does nothing.

Using filezilla to connect via port 22 works fine.

I am using only key based authentication if that matters.

Offline

#2 2015-09-03 14:58:21

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,901
Website

Re: SSH Hangs

Not much to go on here. Please try running ssh with verbose flags and see what's happening when the stall occurs.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#3 2015-09-03 15:15:58

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

$ ssh -v compsci@10.1.1.12
OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 10.1.1.12 [10.1.1.12] port 22.
debug1: Connection established.
debug1: identity file /home/carloabelli/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_dsa-cert type -1
debug1: identity file /home/carloabelli/.ssh/id_ecdsa type 3
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 10.1.1.12:22 as 'compsci'
debug1: SSH2_MSG_KEXINIT sent

I see some file not found errors but those files are there I think. Strange thing is filezilla works fine.

Offline

#4 2015-09-03 15:42:48

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,901
Website

Re: SSH Hangs

Okay, looks like ssh is waiting on the server. Do you have access to the server logs? Anything of note in those regarding ssh access? What is the server running?

Not sure why filezilla works, but ssh doesn't. How have you configured filezilla?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#5 2015-09-03 15:44:22

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

Do not have access to the logs sorry. Sever is running some older version of OSX I do believe. Not much filezilla customization. Just did a quickconnect to 10.1.1.12 with user compsci on port 22.

Offline

#6 2015-09-03 21:00:38

paulkerry
Member
From: Sheffield, UK
Registered: 2014-10-02
Posts: 611

Re: SSH Hangs

It could be a login problem for that particular user only (messed up "." file perhaps?) - do you have and can you try an alternative username account?

Offline

#7 2015-09-03 21:03:37

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

There is also the git user and the same thing happens there. Still very strange that filezilla over sftp works...

Offline

#8 2015-09-03 21:23:23

paulkerry
Member
From: Sheffield, UK
Registered: 2014-10-02
Posts: 611

Re: SSH Hangs

Perhaps interactive shells are disabled and/or the default shell has been changed (to the /bin/nologin equivalent ?) at the server end?

I'd suggest contacting the person who is administering the server - they may have a specific reason why you can't login or if there is a problem, they can inspect the logs.

Offline

#9 2015-09-19 04:25:16

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

Seems to be related to other things. For instance I cannot ssh anywhere:

$ ssh -v thebes.openshells.net       
OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to thebes.openshells.net [23.239.220.55] port 22.

And here the hang occurs as well. Any solution? This should also not be key based: http://www.openshells.net/index.php/2-u … d/7-signup

Offline

#10 2015-09-19 04:34:49

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

Also dropbear works fine...

$ dbclient compsci@10.1.1.12
Last login: Sat Sep 19 00:34:39 2015 from 10.11.1.253
compsci-server:~ compsci$ 

Offline

#11 2015-09-19 18:20:20

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,901
Website

Re: SSH Hangs

Can you post the output of

$ pacman -Qkk openssh
$ ls -l ~/.ssh/config

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#12 2015-09-19 19:20:49

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

$ pacman -Qkk openssh 
openssh: 60 total files, 0 altered files
$ ls -l ~/.ssh/config
ls: cannot access /home/carloabelli/.ssh/config: No such file or directory

Offline

#13 2015-09-19 22:29:34

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,901
Website

Re: SSH Hangs

So there's no alterations to the systemwide ssh_config, and you don't have a user-specific ssh config file that could be overriding it. One last thing I can think to check:

$ type ssh

That will check whether you have 'ssh' aliased to something else, or a /usr/local wrapper script (or alternate version) installed.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#14 2015-09-19 23:05:09

ganastasiou
Member
Registered: 2010-02-03
Posts: 56

Re: SSH Hangs

Can you add more verbose flags? -vvv

Offline

#15 2015-09-20 01:06:46

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

$ type ssh
ssh is /usr/bin/ssh
$ ssh -vvv compsci@10.1.1.12
OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to 10.1.1.12 [10.1.1.12] port 22.
debug1: Connection established.
debug1: identity file /home/carloabelli/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_dsa-cert type -1
debug1: identity file /home/carloabelli/.ssh/id_ecdsa type 3
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 10.1.1.12:22 as 'compsci'
debug3: hostkeys_foreach: reading file "/home/carloabelli/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/carloabelli/.ssh/known_hosts:1
debug3: record_hostkey: found key type RSA in file /home/carloabelli/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 2 keys from 10.1.1.12
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa
debug1: SSH2_MSG_KEXINIT sent

Offline

#16 2015-09-20 08:17:31

ganastasiou
Member
Registered: 2010-02-03
Posts: 56

Re: SSH Hangs

Ok try one more time with the following argument

ssh -o StrictHostKeyChecking=no username@server

Offline

#17 2015-09-20 15:06:20

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

Still hangs. With the -v flag:

$ ssh -o StrictHostKeyChecking=no -v compsci@10.1.1.12
OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 10.1.1.12 [10.1.1.12] port 22.
debug1: Connection established.
debug1: identity file /home/carloabelli/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_dsa-cert type -1
debug1: identity file /home/carloabelli/.ssh/id_ecdsa type 3
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/carloabelli/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 10.1.1.12:22 as 'compsci'
debug1: SSH2_MSG_KEXINIT sent

Offline

#18 2015-09-20 15:48:40

loqs
Member
Registered: 2014-03-06
Posts: 17,440

Re: SSH Hangs

Test to see if the client will connect to a server running the matching version and exclude network issues
if you edit /etc/ssh/sshd_config
add the following 2 lines so that it will only be listening on the loopback interface ( so no unwanted remote access to your system )

ListenAddress 127.0.0.1
ListenAddress ::1

start the sshd service can you then ssh to your username@localhost?
If this fails it should still provide a server log to compare with the client output

Offline

#19 2015-09-20 16:11:03

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

I can connect to my local machine via localhost so this is a network issue it appears. Perhaps a MTU problem? I found http://www.snailbook.com/faq/mtu-mismatch.auto.html. The server MTU for is 1500 and my local one is also higher. I am using a VPN but that MTU is also 1500 so perhaps its the MTU on the VPN server itsself? I feel like it would be high enough, but who know?. Or perhaps it's another problem.

Offline

#20 2015-09-20 16:44:05

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

Must have to do with the MTU of the VPN as I can successfully connect and authenticate to github.com. I will test when I gain access to the network tomorrow. Strange that a VPN would have such a low MTU. Or maybe I have this wrong?

Offline

#21 2015-09-20 18:09:09

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: SSH Hangs

Just a thought, is the server setup to correctly use keys? What about password authentication as a fallback? Also, did you copy your public key to the server? The wiki describes this in great detail, but for now I'll post my SSH config for the server side. The file is /etc/ssh/sshd_config. http://sprunge.us/UTEN. Note that you need to copy the public key to the server first before disabling challenge respone authentication. Use my config as a reference, but do note that 98% of it is defaults.

Otherwise, it doesnt look like you have a key (or if you do, it does not have a password on it). Here is what connecting to my SSH server looks like:

[dmb@dmb-arch-laptop ~]$ ssh -p 3100 johnbobsmith@192.168.1.140
Welcome to JohnBobSmith's Arch Linux server!
Enter passphrase for key '/home/dmb/.ssh/id_rsa': 
Last login: Sun Sep 20 04:58:19 2015 from 192.168.1.146
[johnbobsmith@JohnBobSmith-ArchServer ~]$ 

From you verbose output, it appears you are trying every encryption type. And because the file/directory don't seem to exist, you are having issues. You may want to try generating a public/private key pair, and copying it to the server again. I suggest RSA, but it shouldn't matter too much. Here's the wiki link on ssh keys for further reading: https://wiki.archlinux.org/index.php/Ssh_keys. Good luck! smile


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

#22 2015-09-20 18:15:08

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

Thank you for your thoughts, but I don't this the solution is this simple. Connecting via ssh worked beautifully on my old machine. I have two types of keys, RSA and ECDSA. The RSA one is on the server. Also this is probably not key related or related to the server's config as dropbear did work flawlessly, and it would not have worked if the key's were incorrectly copied or if the configuration were messed up. The thing that is strange to me is why ssh with the same RSA key worked fine for my old laptop but not on this one. Perhaps openssh increased the size of their key authentication packets and they now exceed the MTU.

Offline

#23 2015-09-20 20:24:22

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: SSH Hangs

Maybe you coppied the key to incorrect location then? As per your verbose output...

debug1: identity file /home/carloabelli/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory

Do you have the key /home/carloabelli/.ssh/id_rsa ? Perhaps you spelled something wrong?? I say this because I have had no problems copying keys from one system to the next, so long as the directories and names match up. I'm not great with the MTU stuff, and therefore I'm not sure why that would matter. Especially if your key doesnt seem to exist in the first place. I'd maybe try something like cd ~ && ls -a | grep -i ssh to confirm that the directory exists on your system. I could be interpreting the verbose output wrong, but from what I know, if your SSH key/directory doesnt exist, how can you possibly have a challenge-response or key-based connection. I hope you see where I'm coming from. smile


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

#24 2015-09-20 20:31:26

cabellicar123
Member
Registered: 2015-08-03
Posts: 56

Re: SSH Hangs

No worries smile. I see where you are coming from. Not sure where that "No such file or directory" error is coming from, but the the non-negative value next to the identity type means the key was in fact loaded. The keys not there all report -1.

Just for you peace of mind here is some info:

$ ls ~/.ssh         
id_ecdsa  id_ecdsa.pub  id_rsa  id_rsa.pub  known_hosts

After reading up on this I believe my vpn's mtu is lower and the key authentication packet is being fragmented and therefore lost causing the hang. I will confirm this tomorrow connecting directly to the network.

Offline

#25 2015-09-21 00:46:29

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: SSH Hangs

A quick google search for the SSH2_KEXINIT_SENT message shows the following stackoverflow link: CLICK!. There are many solutions, including setting the MTU at the very bottom. So a low MTU may indeed be causing packet fragmentation, which in turn invalidates the authentication proccess. I'd for sure give that a try tomorrow, and let us know if it works. smile


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

Board footer

Powered by FluxBB