-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TK Can't Connect to EC2 Instance via SSH #135
Comments
Hey @jcderose - thanks for the bug report. Do you have any configs set in your |
No AWS-related configs are set in my https://gist.github.com/jcderose/00e612d024232e9e7e7f It looks like the connection is refused, and then authentication fails. However, when I manually login from the same device, I have no problems:
|
Hey @jcderose - I'm pretty sure I know the issue. You're correct - you can see in the debug log that its an authentication failure because the netssh configs don't have In your transport:
ssh_key: "$HOME/.ssh/key1.pem" The |
If that fix works for you, we should file another bug to default the transport |
Interesting follow-up here: I added the
|
Sorry, one follow-up note: it also looks like my $HOME variable isn't being translated into my actual $HOME path. |
@jcderose If you put your full path does it connect successfully? If so I'll file an issue to default the transport ssh_key to the expanded path from |
@tyler-ball the full (explicit) path didn't work either.
|
What is the full ssh command you are running to connect manually? |
Hmmmm - I don't see the username in the debug info... @fnichol is it supposed to be there? |
@tyler-ball yes the full ssh command I'm using to manually connect is:
|
@tyler-ball, I updated to kitchen-ec2 0.9.3 and am still experiencing the same issue.
|
@gmiranda23, that did not resolve the issue. I updated my
Then ran
|
@jcderose I'm guessing you're limiting your output for brevity (which I appreciate) but just to make sure - are you giving it up to a minute to keep retrying and make sure the connection is still refused? Put another way, does TK keep trying to connect while you can open a different terminal and manually connect? I'm asking because the debug output from your latest comment looks like it has all the correct connection information - the host is I think the next debug step I can think of to try is to manually create the SSH connection from within ruby. Can you run require "net/ssh"
options = {:user_known_hosts_file=>"/dev/null", :keys=>["/Users/obrenrose/.ssh/key1.pem"], :auth_methods=>["publickey"], :user=>"ec2-user"}
c = Net::SSH.start("ec2-52-26-62-202.us-west-2.compute.amazonaws.com","ec2-user", options)
c.exec!("pwd") |
@tyler-ball it looks like I just needed to be patient. I re-ran the |
@jcderose Yay! I'm glad we finally figured it out - thanks for your patience! |
@tyler-ball Hi , I need to make changes to my kitchen.yml in order to connect to EC2 instance via bastion host (proxy). Below is the script to ssh into ec2 instance using proxy host - #!/bin/bash is there a way to call the above script or insert the ssh command options(-o) mentioned above in the kitchen.yml file under the transport section? Existing kitchen.yml -platforms: |
In the process of creating an EC2 instance via TK, TK gets stuck attempting to SSH into the instance.
This "Waiting" message continues endlessly until I quit the process (and then TK barks that the instance wasn't created successfully, even though it's up and running in AWS). While TK is attempting to SSH in during the
kitchen create
process, I'm able to SSH into the instance manually so I know the instance is accepting SSH connections correctly.I'm running the latest version of TK and the kitchen-ec2 driver.
Here's my
.kitchen.yml
file.Here's my environment variables (for the SSH connection, set in my login script):
The text was updated successfully, but these errors were encountered: