BackToMyMac is periodically not working - macos

I am using BackToMyMac to ssh from my home mac to my work mac. Sometimes it works and sometimes it doesn't. When it doesn't work, it can't connect at all. Multiple times I've been able to connect, do some work, disconnected, then tried connecting again an hour later and was unable to. I am certain this is not because the computer is in sleep mode.
How do I go about diagnosing this issue?
Here is my ssh output:
~/>ssh -6 -vvv USER#COMPUTERNAME.ACCOUNTNUMBER.members.btmm.icloud.com
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/USER/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 102: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to COMPUTERNAME.ACCOUNTNUMBER.members.btmm.icloud.com [fd3a:717d:c227:d36b:705f:ef3c:8921:7c56] port 22.
debug1: connect to address fd3a:717d:c227:d36b:705f:ef3c:8921:7c56 port 22: Operation timed out
ssh: connect to host COMPUTERNAME.ACCOUNTNUMBER.members.btmm.icloud.com port 22: Operation timed out

Related

LXD Container fails to SSH out to AWS

I have copied over the .ssh keys and config from my main workstation into an LXD container on it. I have also cleared my ip tables which was an issue with docker I believe preventing my bridge from accessing the internet. I do have access now.
Unfortunately the connection times out when I try to SSH out :(
OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /root/.ssh/config
debug1: /root/.ssh/config line 16: Applying options for rabbit-dev
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no
files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to ec2-##-###-###-###.compute-1.amazonaws.com [##.###.###.###] por
t 22.
debug1: connect to address ##.###.###.### port 22: Connection timed out
ssh: connect to host ec2-##-###-###-###.compute-1.amazonaws.com port 22: Connection t
imed out
My ~/.ssh/config contains
Host rabbit-dev
HostName ec2-##-###-###-###.compute-1.amazonaws.com
IdentityFile ~/.ssh/dev_company.pem
LocalForward 11003 rabbitmq.internal.dev.company.com:80
LocalForward 11004 rabbitmq.internal.dev.company.com:5672
User ec2-user
IdentitiesOnly yes
Docker prevents host operating as a router which is needed for LXD
https://discuss.linuxcontainers.org/t/lxd-and-docker-firewall-redux-how-to-deal-with-forward-policy-set-to-drop/9953/3

Scp'ing from remote server to local server

Currently, I am trying to scp from a remote server (a computer cluster) to my local MAC OSX. However, whenever I try to send a file from the cluster to my computer, I get this error.
ssh: connect to host 73.232.71.182 port 22: Connection timed out
lost connection
Ssh is installed correctly and which scp gives the desired output and this is the output of ssh -v localhost.
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /s1/snagaraj/.ssh/config
debug1: /s1/snagaraj/.ssh/config line 2: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to 73.232.71.182 [73.232.71.182] port 22.
debug1: connect to address 73.232.71.182 port 22: Connection timed out
ssh: connect to host 73.232.71.182 port 22: Connection timed out
Edit 1: What would you want me to check? Ping seems to work and the traceroute command works (but I do not want to reveal the output as it shows where I live).

Unable to connect to amazon ec2 ubuntu instance via ssh using elastic ip

At first, I was able to connect using ssh.
After some time the connection got closed and since then I am not able to connect.
Below is the debug log.
what I can see is the connection is established but again broked.
I have tried rebooting, starting and stopping the server but nothing is working for me. Please help.
username:coding my.name$ ssh -i "aws_ubuntu_16.pem" ubuntu#xx.xx.xx.xx -vv
OpenSSH_7.7p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: resolve_canonicalize: hostname xx.xx.xx.xx is address
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to xx.xx.xx.xx [xx.xx.xx.xx] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file aws_ubuntu_16.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file aws_ubuntu_16.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.7
ssh_exchange_identification: read: Connection reset by peer
Approach 1: The most likely to be possible reason for this issue is
that your IP must have been blacklisted. Could you please check if
your Elastic IP is blacklisted. If yes, whitelist it and try to ssh
again. You can use 'spamhaus.org' for checking the blacklisted
IP and whitelisting it again.
Approach 2: Not recommended, but you can try changing the Elastic IP
if the issue still persists.

Connecting to Bitbucket using ssh through proxy

I have run out of options. I have tried several methods but none have worked so I hope someone can help me.
At work we operate behind a proxy; at the moment I am setting a repository that I would like to pull from and push from. I want to this using ssh so I don't need the password at work or when I take the laptop at home.
The repository is created.
I have created an additional distinct ssh key and added it in bitbucket setting profile.
I have loaded the ssh key using the following command - ssh-add ~/.ssh/personal
I have checked and the key is loaded.
when I try to connect to my repository,using clone or any other action(push or pull),it doesn't work
operation timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have also tried to create a config file in .ssh/ with the following values
Host personalid
HostName bitbucket.org
IdentityFile ~/.ssh/personal
but still it doesn't work
I don't know whether is a proxy issue or something else, I thought ssh should allow me to bypass everything.
Can someone give me an idea on how to diagnose the problem?
Thank you
=========
UPDATE: result of the command ssh -Tv hg#bitbucket.org
ssh -Tv hg#bitbucket.org
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/username/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to bitbucket.org [131.103.20.167] port 22.
debug1: connect to address 131.103.20.167 port 22: Operation timed out
debug1: Connecting to bitbucket.org [131.103.20.168] port 22.
debug1: connect to address 131.103.20.168 port 22: Operation timed out
ssh: connect to host bitbucket.org port 22: Operation timed out
=========
If i use port 443
ssh -Tv -p 443 hg#bitbucket.org
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/username/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to bitbucket.org [131.103.20.167] port 443.
debug1: connect to address 131.103.20.167 port 443: Operation timed out
debug1: Connecting to bitbucket.org [131.103.20.168] port 443.
debug1: connect to address 131.103.20.168 port 443: Operation timed out
ssh: connect to host bitbucket.org port 443: Operation timed out
when trying ssh -Tvp443 hg#altssh.bitbucket.or
ssh -Tvp443 hg#altssh.bitbucket.org
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/username/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to altssh.bitbucket.org [131.103.20.174] port 443.
debug1: connect to address 131.103.20.174 port 443: Operation timed out
ssh: connect to host altssh.bitbucket.org port 443: Operation timed out
The best diagnosis would be to fake an SSH session:
ssh -Tv hg#bitbucket.org
(It doesn't matter whether you're using Git or Mercurial; this test does the same thing either way.)
There'll be a wall of output from the command, thanks to the -v, but the first thing to look for would be a line like this at the end with your specific username:
logged in as cpu2007.
That will establish that a) you're reaching Bitbucket and b) your key is added to your account. If you don't see a line like that, then that should help you diagnose your problem.

ssh: connect to host x.x.x.x port 22: Operation timed out

I'm trying to ssh from mac into ubuntu
this is the error msg I got:
OpenSSH_5.9p1, OpenSSL 0.9.8x 10 May 2012
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.0.10 [192.168.0.10] port 22.
ssh: connect to host 192.168.0.10 port 22: Operation timed out
What does it mean?
You probably have a firewall running on that machine (192.168.0.10) blocking access on port 22. That would be my first guess at least.

Resources