0

I am trying to SSH connect from my MacBook to my Ubuntu machine. I have typed in this command ssh -p 22 -vvv <username>@<ip> The firewall is also disabled in the server side, and typed systemctl status sshd to make sure if it is open.

It connects, but does not show the prompt at all.

OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line  48: Applying options for *
debug1: /etc/ssh/ssh_config line 52: Applying options for *
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to <ip> port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /Users/sss/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/sss/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/sss/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/sss/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/sss/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/sss/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/sss/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/sss/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6

It always seems to get stuck in the last line.

I am testing my MacBook on a different network, but when I try the same command in the same Wifi, it works perfectly.

(I've already tried various stuff in the internet and still does not work) I just started using Ubuntu, so the problem might actually be simple.

  • Are you saying the client machine can connect to the server from one network, but the same client machine trying to connect to the same server from another network gets stuck at that point? – rfc2460 Feb 2 at 10:06
  • Unless the use of DNS by sshd is disabled in /etc/ssh/sshd_config on the Ubuntu server, it might be trying to find out the name of the system you're connecting from - and if you're in another private network behind a NAT, that is unlikely to succeed. Try adding/uncommenting UseDNS no in sshd_config and then restarting sshd with systemctl restart sshd. – telcoM Feb 2 at 10:19
  • @telcoM It is already uncommented in the file. – Mallow Marsh Feb 6 at 10:22
  • @rfc2460 Yes, it connects without getting stuck when I'm in the same network. – Mallow Marsh Feb 6 at 10:24
  • @MallowMarsh Same network as what exactly? A packet capture from each end while you are having this problem would definitely help debugging the issue. – rfc2460 Feb 9 at 12:05

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.