Can't SSH into EC2 from my mac but can from other devices
![Multi tool use Multi tool use](http://sgv.ssvwv.com/sg/ssvwvcomimagb.png)
Multi tool use
I am trying to connect into an EC2 instance (i am using a mac) which has a Security Group allowing all inbound traffic over ssh (port 22) but i'm unable to access. I'm having a little delay before getting an Operation timed out.
I already tried it over other devices such a raspberry pi and another macbook and the connection was successful.
I got access to the raspberry pi over ssh and tried the connection to my EC2 from the terminal; thought my ssh client or the port status could be the issue but after doing this i'm not really sure if this is the case.
This is the message i get when trying to connect:
ssh: connect to host x.x.x.x port 22: Operation timed out
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
Things already verified:
- Security Group allowing traffic over port 22.
- Instance rebooted/recreated.
- DNS and Public IP address changed after instance reboot.
- SSH connection successful over other devices.
- SSH connection to other devices from this mac successful.
- Firewall turned off.
- DNS flushed.
- Ping performed with success.
Any help is really appreciated it.
macos amazon-web-services amazon-ec2 ssh
add a comment |
I am trying to connect into an EC2 instance (i am using a mac) which has a Security Group allowing all inbound traffic over ssh (port 22) but i'm unable to access. I'm having a little delay before getting an Operation timed out.
I already tried it over other devices such a raspberry pi and another macbook and the connection was successful.
I got access to the raspberry pi over ssh and tried the connection to my EC2 from the terminal; thought my ssh client or the port status could be the issue but after doing this i'm not really sure if this is the case.
This is the message i get when trying to connect:
ssh: connect to host x.x.x.x port 22: Operation timed out
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
Things already verified:
- Security Group allowing traffic over port 22.
- Instance rebooted/recreated.
- DNS and Public IP address changed after instance reboot.
- SSH connection successful over other devices.
- SSH connection to other devices from this mac successful.
- Firewall turned off.
- DNS flushed.
- Ping performed with success.
Any help is really appreciated it.
macos amazon-web-services amazon-ec2 ssh
Were all these attempts from the same network? Sometimes, corporate networks block outbound SSH connections. If it works from other devices and the security group is open for all IP addresses, then the problem is with the Mac (and maybe its network), not AWS. If there is a delay before receiving that error, it suggests that the Mac is unable to reach the EC2 instance, as opposed to being denied access.
– John Rotenstein
Dec 30 '18 at 2:21
@JohnRotenstein I tried it from 2 different networks, one at work and home, from both I was able to ssh before. Regarding the delay, it is happening and as you say i don't think access is being denied. I was able to ping my instance successfully.
– Gustavo Mungarro
Dec 30 '18 at 19:40
Ping is rarely a good test, since it requires specific ports to be open in a Security Group. It typically won't work for EC2 instances. I would suggest launching a new Amazon Linux instance and see whether you can SSH into it, to try and figure out what is happening.
– John Rotenstein
Dec 30 '18 at 22:38
@JohnRotenstein Can't figure out what's going on after launching another AMI and failing to ssh again, i even launched it in another AZ. Thanks for all your help in advance.
– Gustavo Mungarro
Dec 31 '18 at 1:43
@JohnRotenstein One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 10 at 0:30
add a comment |
I am trying to connect into an EC2 instance (i am using a mac) which has a Security Group allowing all inbound traffic over ssh (port 22) but i'm unable to access. I'm having a little delay before getting an Operation timed out.
I already tried it over other devices such a raspberry pi and another macbook and the connection was successful.
I got access to the raspberry pi over ssh and tried the connection to my EC2 from the terminal; thought my ssh client or the port status could be the issue but after doing this i'm not really sure if this is the case.
This is the message i get when trying to connect:
ssh: connect to host x.x.x.x port 22: Operation timed out
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
Things already verified:
- Security Group allowing traffic over port 22.
- Instance rebooted/recreated.
- DNS and Public IP address changed after instance reboot.
- SSH connection successful over other devices.
- SSH connection to other devices from this mac successful.
- Firewall turned off.
- DNS flushed.
- Ping performed with success.
Any help is really appreciated it.
macos amazon-web-services amazon-ec2 ssh
I am trying to connect into an EC2 instance (i am using a mac) which has a Security Group allowing all inbound traffic over ssh (port 22) but i'm unable to access. I'm having a little delay before getting an Operation timed out.
I already tried it over other devices such a raspberry pi and another macbook and the connection was successful.
I got access to the raspberry pi over ssh and tried the connection to my EC2 from the terminal; thought my ssh client or the port status could be the issue but after doing this i'm not really sure if this is the case.
This is the message i get when trying to connect:
ssh: connect to host x.x.x.x port 22: Operation timed out
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
Things already verified:
- Security Group allowing traffic over port 22.
- Instance rebooted/recreated.
- DNS and Public IP address changed after instance reboot.
- SSH connection successful over other devices.
- SSH connection to other devices from this mac successful.
- Firewall turned off.
- DNS flushed.
- Ping performed with success.
Any help is really appreciated it.
macos amazon-web-services amazon-ec2 ssh
macos amazon-web-services amazon-ec2 ssh
edited Jan 3 at 1:38
Gustavo Mungarro
asked Dec 30 '18 at 0:22
Gustavo MungarroGustavo Mungarro
12
12
Were all these attempts from the same network? Sometimes, corporate networks block outbound SSH connections. If it works from other devices and the security group is open for all IP addresses, then the problem is with the Mac (and maybe its network), not AWS. If there is a delay before receiving that error, it suggests that the Mac is unable to reach the EC2 instance, as opposed to being denied access.
– John Rotenstein
Dec 30 '18 at 2:21
@JohnRotenstein I tried it from 2 different networks, one at work and home, from both I was able to ssh before. Regarding the delay, it is happening and as you say i don't think access is being denied. I was able to ping my instance successfully.
– Gustavo Mungarro
Dec 30 '18 at 19:40
Ping is rarely a good test, since it requires specific ports to be open in a Security Group. It typically won't work for EC2 instances. I would suggest launching a new Amazon Linux instance and see whether you can SSH into it, to try and figure out what is happening.
– John Rotenstein
Dec 30 '18 at 22:38
@JohnRotenstein Can't figure out what's going on after launching another AMI and failing to ssh again, i even launched it in another AZ. Thanks for all your help in advance.
– Gustavo Mungarro
Dec 31 '18 at 1:43
@JohnRotenstein One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 10 at 0:30
add a comment |
Were all these attempts from the same network? Sometimes, corporate networks block outbound SSH connections. If it works from other devices and the security group is open for all IP addresses, then the problem is with the Mac (and maybe its network), not AWS. If there is a delay before receiving that error, it suggests that the Mac is unable to reach the EC2 instance, as opposed to being denied access.
– John Rotenstein
Dec 30 '18 at 2:21
@JohnRotenstein I tried it from 2 different networks, one at work and home, from both I was able to ssh before. Regarding the delay, it is happening and as you say i don't think access is being denied. I was able to ping my instance successfully.
– Gustavo Mungarro
Dec 30 '18 at 19:40
Ping is rarely a good test, since it requires specific ports to be open in a Security Group. It typically won't work for EC2 instances. I would suggest launching a new Amazon Linux instance and see whether you can SSH into it, to try and figure out what is happening.
– John Rotenstein
Dec 30 '18 at 22:38
@JohnRotenstein Can't figure out what's going on after launching another AMI and failing to ssh again, i even launched it in another AZ. Thanks for all your help in advance.
– Gustavo Mungarro
Dec 31 '18 at 1:43
@JohnRotenstein One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 10 at 0:30
Were all these attempts from the same network? Sometimes, corporate networks block outbound SSH connections. If it works from other devices and the security group is open for all IP addresses, then the problem is with the Mac (and maybe its network), not AWS. If there is a delay before receiving that error, it suggests that the Mac is unable to reach the EC2 instance, as opposed to being denied access.
– John Rotenstein
Dec 30 '18 at 2:21
Were all these attempts from the same network? Sometimes, corporate networks block outbound SSH connections. If it works from other devices and the security group is open for all IP addresses, then the problem is with the Mac (and maybe its network), not AWS. If there is a delay before receiving that error, it suggests that the Mac is unable to reach the EC2 instance, as opposed to being denied access.
– John Rotenstein
Dec 30 '18 at 2:21
@JohnRotenstein I tried it from 2 different networks, one at work and home, from both I was able to ssh before. Regarding the delay, it is happening and as you say i don't think access is being denied. I was able to ping my instance successfully.
– Gustavo Mungarro
Dec 30 '18 at 19:40
@JohnRotenstein I tried it from 2 different networks, one at work and home, from both I was able to ssh before. Regarding the delay, it is happening and as you say i don't think access is being denied. I was able to ping my instance successfully.
– Gustavo Mungarro
Dec 30 '18 at 19:40
Ping is rarely a good test, since it requires specific ports to be open in a Security Group. It typically won't work for EC2 instances. I would suggest launching a new Amazon Linux instance and see whether you can SSH into it, to try and figure out what is happening.
– John Rotenstein
Dec 30 '18 at 22:38
Ping is rarely a good test, since it requires specific ports to be open in a Security Group. It typically won't work for EC2 instances. I would suggest launching a new Amazon Linux instance and see whether you can SSH into it, to try and figure out what is happening.
– John Rotenstein
Dec 30 '18 at 22:38
@JohnRotenstein Can't figure out what's going on after launching another AMI and failing to ssh again, i even launched it in another AZ. Thanks for all your help in advance.
– Gustavo Mungarro
Dec 31 '18 at 1:43
@JohnRotenstein Can't figure out what's going on after launching another AMI and failing to ssh again, i even launched it in another AZ. Thanks for all your help in advance.
– Gustavo Mungarro
Dec 31 '18 at 1:43
@JohnRotenstein One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 10 at 0:30
@JohnRotenstein One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 10 at 0:30
add a comment |
1 Answer
1
active
oldest
votes
It seems that you can remote by other devices and this issue is only still happening on your MAC. Try this on your MAC and try to remote again:
Flush your DNS
I don't know which Mac OS you are using so I put the link here: (https://help.dreamhost.com/hc/en-us/articles/214981288-Flushing-your-DNS-cache-in-Mac-OS-X-and-Linux)
If still cannot, you can try to open some protocol ports on that instances like:
ICMP, Echo Reply, ...
then try to reach by that protocol commands:
Ping, telnet, ...
If the result is cannot too, so it must be that your MAC cannot even reach to that instance network, then try to ensure that your MAC can reach the instance's network first.
Flushed my DNS, sill unable to ssh. I was able to ping the instance though.
– Gustavo Mungarro
Dec 30 '18 at 19:38
@GustavoMungarro Hmm, then I thought I should be the Firewall, do you ensure that your MAC's ssh client works with others machine? Have you tried to remote into other machines yet, except that instance?
– Leon
Dec 31 '18 at 19:17
Firewall is off and I've made an ssh connection successfully with other devices (Raspberry Pi), from which I ssh into the instance with no problem at all.
– Gustavo Mungarro
Jan 3 at 1:29
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 3 at 1:39
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53974369%2fcant-ssh-into-ec2-from-my-mac-but-can-from-other-devices%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It seems that you can remote by other devices and this issue is only still happening on your MAC. Try this on your MAC and try to remote again:
Flush your DNS
I don't know which Mac OS you are using so I put the link here: (https://help.dreamhost.com/hc/en-us/articles/214981288-Flushing-your-DNS-cache-in-Mac-OS-X-and-Linux)
If still cannot, you can try to open some protocol ports on that instances like:
ICMP, Echo Reply, ...
then try to reach by that protocol commands:
Ping, telnet, ...
If the result is cannot too, so it must be that your MAC cannot even reach to that instance network, then try to ensure that your MAC can reach the instance's network first.
Flushed my DNS, sill unable to ssh. I was able to ping the instance though.
– Gustavo Mungarro
Dec 30 '18 at 19:38
@GustavoMungarro Hmm, then I thought I should be the Firewall, do you ensure that your MAC's ssh client works with others machine? Have you tried to remote into other machines yet, except that instance?
– Leon
Dec 31 '18 at 19:17
Firewall is off and I've made an ssh connection successfully with other devices (Raspberry Pi), from which I ssh into the instance with no problem at all.
– Gustavo Mungarro
Jan 3 at 1:29
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 3 at 1:39
add a comment |
It seems that you can remote by other devices and this issue is only still happening on your MAC. Try this on your MAC and try to remote again:
Flush your DNS
I don't know which Mac OS you are using so I put the link here: (https://help.dreamhost.com/hc/en-us/articles/214981288-Flushing-your-DNS-cache-in-Mac-OS-X-and-Linux)
If still cannot, you can try to open some protocol ports on that instances like:
ICMP, Echo Reply, ...
then try to reach by that protocol commands:
Ping, telnet, ...
If the result is cannot too, so it must be that your MAC cannot even reach to that instance network, then try to ensure that your MAC can reach the instance's network first.
Flushed my DNS, sill unable to ssh. I was able to ping the instance though.
– Gustavo Mungarro
Dec 30 '18 at 19:38
@GustavoMungarro Hmm, then I thought I should be the Firewall, do you ensure that your MAC's ssh client works with others machine? Have you tried to remote into other machines yet, except that instance?
– Leon
Dec 31 '18 at 19:17
Firewall is off and I've made an ssh connection successfully with other devices (Raspberry Pi), from which I ssh into the instance with no problem at all.
– Gustavo Mungarro
Jan 3 at 1:29
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 3 at 1:39
add a comment |
It seems that you can remote by other devices and this issue is only still happening on your MAC. Try this on your MAC and try to remote again:
Flush your DNS
I don't know which Mac OS you are using so I put the link here: (https://help.dreamhost.com/hc/en-us/articles/214981288-Flushing-your-DNS-cache-in-Mac-OS-X-and-Linux)
If still cannot, you can try to open some protocol ports on that instances like:
ICMP, Echo Reply, ...
then try to reach by that protocol commands:
Ping, telnet, ...
If the result is cannot too, so it must be that your MAC cannot even reach to that instance network, then try to ensure that your MAC can reach the instance's network first.
It seems that you can remote by other devices and this issue is only still happening on your MAC. Try this on your MAC and try to remote again:
Flush your DNS
I don't know which Mac OS you are using so I put the link here: (https://help.dreamhost.com/hc/en-us/articles/214981288-Flushing-your-DNS-cache-in-Mac-OS-X-and-Linux)
If still cannot, you can try to open some protocol ports on that instances like:
ICMP, Echo Reply, ...
then try to reach by that protocol commands:
Ping, telnet, ...
If the result is cannot too, so it must be that your MAC cannot even reach to that instance network, then try to ensure that your MAC can reach the instance's network first.
answered Dec 30 '18 at 3:11
![](https://i.stack.imgur.com/I3V1k.png?s=32&g=1)
![](https://i.stack.imgur.com/I3V1k.png?s=32&g=1)
LeonLeon
536
536
Flushed my DNS, sill unable to ssh. I was able to ping the instance though.
– Gustavo Mungarro
Dec 30 '18 at 19:38
@GustavoMungarro Hmm, then I thought I should be the Firewall, do you ensure that your MAC's ssh client works with others machine? Have you tried to remote into other machines yet, except that instance?
– Leon
Dec 31 '18 at 19:17
Firewall is off and I've made an ssh connection successfully with other devices (Raspberry Pi), from which I ssh into the instance with no problem at all.
– Gustavo Mungarro
Jan 3 at 1:29
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 3 at 1:39
add a comment |
Flushed my DNS, sill unable to ssh. I was able to ping the instance though.
– Gustavo Mungarro
Dec 30 '18 at 19:38
@GustavoMungarro Hmm, then I thought I should be the Firewall, do you ensure that your MAC's ssh client works with others machine? Have you tried to remote into other machines yet, except that instance?
– Leon
Dec 31 '18 at 19:17
Firewall is off and I've made an ssh connection successfully with other devices (Raspberry Pi), from which I ssh into the instance with no problem at all.
– Gustavo Mungarro
Jan 3 at 1:29
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 3 at 1:39
Flushed my DNS, sill unable to ssh. I was able to ping the instance though.
– Gustavo Mungarro
Dec 30 '18 at 19:38
Flushed my DNS, sill unable to ssh. I was able to ping the instance though.
– Gustavo Mungarro
Dec 30 '18 at 19:38
@GustavoMungarro Hmm, then I thought I should be the Firewall, do you ensure that your MAC's ssh client works with others machine? Have you tried to remote into other machines yet, except that instance?
– Leon
Dec 31 '18 at 19:17
@GustavoMungarro Hmm, then I thought I should be the Firewall, do you ensure that your MAC's ssh client works with others machine? Have you tried to remote into other machines yet, except that instance?
– Leon
Dec 31 '18 at 19:17
Firewall is off and I've made an ssh connection successfully with other devices (Raspberry Pi), from which I ssh into the instance with no problem at all.
– Gustavo Mungarro
Jan 3 at 1:29
Firewall is off and I've made an ssh connection successfully with other devices (Raspberry Pi), from which I ssh into the instance with no problem at all.
– Gustavo Mungarro
Jan 3 at 1:29
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 3 at 1:39
One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 3 at 1:39
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53974369%2fcant-ssh-into-ec2-from-my-mac-but-can-from-other-devices%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
U34MOn4eW3G52Jh 6 6S3,0wEfJIjSARG4lS8Rwy,zvZxWsC,XdyLGO1vtHYaXZopl11ceLMP szTU pP6zToauCV5Pkmm Q,wxdb B
Were all these attempts from the same network? Sometimes, corporate networks block outbound SSH connections. If it works from other devices and the security group is open for all IP addresses, then the problem is with the Mac (and maybe its network), not AWS. If there is a delay before receiving that error, it suggests that the Mac is unable to reach the EC2 instance, as opposed to being denied access.
– John Rotenstein
Dec 30 '18 at 2:21
@JohnRotenstein I tried it from 2 different networks, one at work and home, from both I was able to ssh before. Regarding the delay, it is happening and as you say i don't think access is being denied. I was able to ping my instance successfully.
– Gustavo Mungarro
Dec 30 '18 at 19:40
Ping is rarely a good test, since it requires specific ports to be open in a Security Group. It typically won't work for EC2 instances. I would suggest launching a new Amazon Linux instance and see whether you can SSH into it, to try and figure out what is happening.
– John Rotenstein
Dec 30 '18 at 22:38
@JohnRotenstein Can't figure out what's going on after launching another AMI and failing to ssh again, i even launched it in another AZ. Thanks for all your help in advance.
– Gustavo Mungarro
Dec 31 '18 at 1:43
@JohnRotenstein One thing I noticed is that I used a different .pem file which is supposed to not work for that instance and the error was the same, it looks like my Mac cannot reach it.
– Gustavo Mungarro
Jan 10 at 0:30