2

All of a sudden my ability to scp from remote servers to my local machine (a Mac) are failing. I don't know when exactly this began, but something must have changed that I'm not aware of as it was working perfectly previously.

I have 2 servers, and my local machine everything is secured with RSA keys. Server A can scp to and from Server B without a problem, and vice versa.

My Mac can scp items to both servers, however, neither server can scp anything to my Mac when I'm logged in to them (something I previously have had no problems with).


I've read every thread I can find with a similar problem, but they seem to have been resolved by the login message problem, but none of my shells emit any login messages other than the usual Last login...

Initially, I thought this was a problem with being on a private home network, and it was maybe the router blocking traffic etc, but the problem persists on my university network where all the machines are within the same domain.

With firewall off completely the connection still fails.

This is the debug I always receive:

user@ServerB:~$ scp -vvv test.txt joehealey@mymac:~/Desktop/
Executing: program /usr/bin/ssh host 137.205.183.84, user joehealey, command scp -v -r -t ~/Desktop/
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 137.205.183.84 [137.205.183.84] port 22.
debug1: connect to address 137.205.183.84 port 22: Connection timed out
ssh: connect to host 137.205.183.84 port 22: Connection timed out
lost connection

If it truly is failing to connect on port 22, I don't understand why this has only suddenly started to be a problem?

Both Server A and B are Ubuntu servers. Mac is OSX El Capitan (using iTerm2).

Can't currently think of any other info to provide, but will edit as necessary.

Edit 1:

In response to the comments, this is the Mac's output from lsof:

COMMAND PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
launchd   1 root   32u  IPv6 0x678fdc0d37f8aa53      0t0  TCP *:22 (LISTEN)
launchd   1 root   37u  IPv4 0x678fdc0d37f9152b      0t0  TCP *:22 (LISTEN)
launchd   1 root   39u  IPv6 0x678fdc0d37f8aa53      0t0  TCP *:22 (LISTEN)
launchd   1 root   44u  IPv4 0x678fdc0d37f9152b      0t0  TCP *:22 (LISTEN)

̶s̶s̶h̶,̶ ̶r̶s̶y̶n̶c̶ ̶a̶n̶d̶ ̶s̶f̶t̶p̶ ̶e̶t̶c̶ ̶a̶l̶l̶ ̶w̶o̶r̶k̶ ̶f̶i̶n̶e̶. Though the laptop (nor an additional PC from home that I tested) can be ssh'd to from either server.

Edit 2:

Here's the traceroute from my mac to 'Server B':

Selected device en1, address 192.168.0.10, port 58844 for outgoing packets
Tracing the path to 137.205.68.184 on TCP port 80 (http), 30 hops max
 1  192.168.0.1  4.495 ms  2.788 ms  0.983 ms
 2  * * *
 3  be368.pr3.hobir.isp.sky.com (2.120.8.32)  26.890 ms  50.091 ms  22.748 ms
 4  linx-gw2.ja.net (195.66.236.15)  23.971 ms  24.879 ms  25.449 ms
 5  ae23.londhx-sbr1.ja.net (146.97.35.165)  23.791 ms  24.935 ms  27.064 ms
 6  ae29.londpg-sbr2.ja.net (146.97.33.2)  31.917 ms  29.909 ms  28.199 ms
 7  ae31.erdiss-sbr2.ja.net (146.97.33.22)  27.841 ms  27.472 ms  29.663 ms
 8  ae23.birmub-rbr1.ja.net (146.97.37.154)  28.239 ms  29.382 ms  30.064 ms
 9  ae0.warwuw-rbr1.wmrn.ja.net (193.62.80.70)  27.122 ms  27.439 ms  26.995 ms
10  193.63.208.46  28.445 ms  30.121 ms  29.001 ms
11  gw-uw-1e.warwick.ac.uk (194.66.251.250)  39.050 ms  34.078 ms  28.284 ms
12  * * *
13  * * *
14  * * *
15  137.205.52.1  44.081 ms  29.241 ms  35.046 ms
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *
Destination not reached

I don't fully understand it saying it isn't reached (albeit in 30 hops), since the SSH connection from Mac to server is fine.

and from Server B to my mac:

Selected device eth0, address 137.205.68.184, port 50671 for outgoing packets
Tracing the path to 94.2.125.120 on TCP port 22 (ssh), 30 hops max
 1  137.205.71.254  0.259 ms  0.250 ms  0.382 ms
 2  137.205.52.29  0.941 ms  0.702 ms  0.917 ms
 3  172.31.11.85  58.918 ms  0.972 ms  0.883 ms
 4  172.31.255.86  0.883 ms  0.832 ms  0.737 ms
 5  172.31.254.126  0.594 ms  0.517 ms  0.710 ms
 6  172.31.251.30  0.779 ms  0.794 ms  0.589 ms
 7  gw-uw-2.warwick.ac.uk (194.66.251.253)  1.339 ms  0.867 ms  1.243 ms
 8  193.63.208.45  15.719 ms  1.079 ms  1.228 ms
 9  ae25.lowdss-sbr1.ja.net (146.97.37.157)  2.251 ms  2.249 ms  2.402 ms
10  ae31.londtw-sbr2.ja.net (146.97.33.30)  11.367 ms  5.537 ms  5.698 ms
11  ae29.londtn-sbr1.ja.net (146.97.33.10)  5.663 ms  5.424 ms  5.513 ms
12  ae0.londtn-ban3.ja.net (146.97.35.170)  5.884 ms  5.321 ms  5.992 ms
13  be1028.er12.thlon.isp.sky.com (195.66.225.234)  6.040 ms  6.236 ms  6.363 ms
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *
Destination not reached

It seems like it may be getting stuck at Sky, my ISP?

  • In System Preferences -> Sharing, is 'Remote Login' still enabled? This controls the Mac's SSH server. – DopeGhoti Sep 1 '17 at 15:29
  • 1
    The debug output Connection timed out is your big clue as to the problem. I would troubleshoot general connectivity starting at Server A and B to your Mac (http, ping, etc.). If that works, focus on the socket itself on your Mac, using ncat/netcat from both Server A and Server B. The handshake/session is not getting established between the two. Traffic either isn't making it to the Mac, or the replies are not making it back to the Servers. – 0xSheepdog Sep 1 '17 at 15:39
  • 2
    I forgot to add that SSH works perfectly still (knew there was something I missed from the post). All other connectivity seems to work fine (rsync/sftp/ssh) – Joe Healey Sep 1 '17 at 15:40
  • So scp test.txt joehealey@mymac:~/Desktop/ times out but ssh joehealey@mymac succeeds? – Mark Plotnick Sep 1 '17 at 15:42
  • 1
    @Deathgrip, I've added the output of lsof to the OP. I also decided to check my Windows PC at home via MobaXterm, and that machine also cannot receive scp/ssh connections from the servers. I've now tried, 2 remotes, 2 locals, 2 different networks. The only thing I can think that the servers both have in common is that they're both on the University network (137.205...) and that perhaps something changed with the Uni network that is now blocking certain traffic, but this seems unlikely? – Joe Healey Sep 2 '17 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.