You are not logged in.
I just installed OpenSSH but I can't connect to a server. After I type in
ssh -p 22 <user@address>
it just hangs on me. I am trying to connect to a school server. The school does not
list the port to use for connection but I assume it is 22.
I've made sure that my router has port 22 forwarded to my computer, and gone through the troubleshooting for OpenSSH. I have found other people having issues with OpenSSH hanging after authentication, but mine doesn't even get to authentication.
Last edited by xu564856686 (2016-10-11 03:54:36)
Offline
ssh -vvv -p 22 <user@address>Moving to NC...
Offline
I've made sure that my router has port 22 forwarded to my computer
When connecting to port 22 on a remote machine port 22 of your router should not be playing any part in it so that step is unneeded but should not be causing the issue.
Offline
The school does not list the port to use for connection but I assume it is 22.
Why assume when you can check:
nmap addressThat said, this is not the problem here. If the destination were not listening on that port it would exit immediately.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
To initiate connection to a remote server you don't need to configure anything on your router.
To better check what's going on you can use one or more -v options with ssh.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
Ok, after running
ssh -vvv -p 22 user@server,
I get connection timed out messages.
Offline
is the server firewall configured to accept traffic on port 22
Offline
Yes, I confirmed today in person that the server port is 22.
Offline
that's not what I asked at all.
Offline
Ok, after running
ssh -vvv -p 22 user@server,
I get connection timed out messages.
That isn't helpful: https://bbs.archlinux.org/viewtopic.php?id=57855
Offline
that's not what I asked at all.
Well then I don't understand what you asked. Do you mean the firewall on my own computer?
That isn't helpful: https://bbs.archlinux.org/viewtopic.php?id=57855
OK sorry. I was in a rush to get other stuff done today and I couldn't work very long on this issue. I will try again with it tomorrow and post more details.
Offline
HiImTye wrote:that's not what I asked at all.
Well then I don't understand what you asked. Do you mean the firewall on my own computer?
whichever computer is the SSH server
Offline
xu564856686 wrote:HiImTye wrote:that's not what I asked at all.
Well then I don't understand what you asked. Do you mean the firewall on my own computer?
whichever computer is the SSH server
That's the school server. I asked my teacher and she can connect to it through port 22.
Offline
Did you forget the request for information in post #2 clarified in post #10.
Offline
Did you forget the request for information in post #2 clarified in post #10.
No I did not.
ssh -vvv -p 22 <user>@<address>
OpenSSH_7.3p1, OpenSSL 1.0.2j 26 Sep 2016
debug1: Reading configuration data /home/<user>/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "<address>" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to <address> [ip address] port 22.
debug1: connect to address <ip address> port 22: Connection timed out
debug1: Connecting to <address> [ip address] port 22.Last edited by xu564856686 (2016-10-04 15:36:18)
Offline
Something appears to be filtering your connection to the server dropping the packets and not sending any response.
For comparison what is the out of
$ ssh -vvv -p 22 git@github.comThis is just to see if an ssh connection can be established on port 22 to a different server.
Offline
$ ssh -vvv -p 22 git@github.com
OpenSSH_7.3p1, OpenSSL 1.0.2j 26 Sep 2016
debug1: Reading configuration data /home/<user>/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "github.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to github.com [192.30.253.113] port 22.
debug1: Connection established.
debug1: identity file /home/<user>/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<user>/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<user>/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<user>/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<user>/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<user>/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<user>/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<user>/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version libssh-0.7.0
debug1: no match: libssh-0.7.0
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to github.com:22 as 'git'
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-dss,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc
debug2: MACs ctos: hmac-sha1,hmac-sha2-256,hmac-sha2-512
debug2: MACs stoc: hmac-sha1,hmac-sha2-256,hmac-sha2-512
debug2: compression ctos: none,zlib,zlib@openssh.com
debug2: compression stoc: none,zlib,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug2: key: /home/<user>/.ssh/id_rsa (0x564449b7f470)
debug2: key: /home/<user>/.ssh/id_dsa ((nil))
debug2: key: /home/<user>/.ssh/id_ecdsa ((nil))
debug2: key: /home/<user>/.ssh/id_ed25519 ((nil))
debug3: send packet: type 5
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/b<user>/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/<user>/.ssh/id_dsa
debug3: no such identity: /home/<user>/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/<user>/.ssh/id_ecdsa
debug3: no such identity: /home/<user>/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/<user>/.ssh/id_ed25519
debug3: no such identity: /home/<user>/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).Last edited by xu564856686 (2016-10-04 15:58:15)
Offline
So the filtering is not occurring for github.com but is for the server you wish to connect to so it appears to either be selective or is only on the route to the server you wish to connect to and not on the route to github.
Offline
Is this likely an issue with the server? My school recently changed their network setup and that may have caused it.
Offline
Is the server IP ipv4 or ipv6? You could install tcptraceroute from the aur and try to see where the packets are getting filtered, it might provide more clues as to what is wrong.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
are you connecting to a server in the ranges of 10.0.0.0/8, 192.168.0.0/24, 169.254.0.0/16, 172.16.0.0/12, or 127.0.0.0/8?
Offline
Also, you say your teacher connects fine on port 22, but are they connecting from within the school's network and are you trying to connect from off campus?
Many universities allow internal connections but block anything originating from the outside.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Is the server IP ipv4 or ipv6? You could install tcptraceroute from the aur and try to see where the packets are getting filtered, it might provide more clues as to what is wrong.
This is what I get:
$ sudo tcptraceroute -p 22 <address>
Selected device wlp3s0, address 10.0.0.154, port 22 for outgoing packets
Tracing the path to <address> (ip address) on TCP port 80 (http), 30 hops max
1 10.0.0.1 404.959 ms 6.622 ms 7.399 ms
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
7 * * *
and so onare you connecting to a server in the ranges of 10.0.0.0/8, 192.168.0.0/24, 169.254.0.0/16, 172.16.0.0/12, or 127.0.0.0/8?
No, the IP address starts with 172.21.
Many universities allow internal connections but block anything originating from the outside.
No, I have previously been able to connect off-campus with PuTTY on my Windows laptop.
Offline
No, the IP address starts with 172.21.
172.21.*.* is in the 172.16.0.0/12 range see
Private_network see also Classless_Inter-Domain_Routing#IPv4_CIDR_blocks to explain the notation.
Offline
xu564856686 wrote:No, the IP address starts with 172.21.
172.21.*.* is in the 172.16.0.0/12 range see
Private_network see also Classless_Inter-Domain_Routing#IPv4_CIDR_blocks to explain the notation.
essentially, you need the internet facing IP address of the server, not the private networking IP
Offline