Skip to content
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

kitchen login fails if ssh_key is a relative path. #26

Closed
markbate opened this issue Dec 11, 2013 · 4 comments
Closed

kitchen login fails if ssh_key is a relative path. #26

markbate opened this issue Dec 11, 2013 · 4 comments
Labels

Comments

@markbate
Copy link

I'm not entirely sure where this bubbles up from (might be a test-kitchen issue), but kitchen login doesn't seem to like relative paths for ssh keys.

Full path:

- name: ec2-ubuntu-12.04
  driver_name: ec2
  driver_plugin: ec2
  driver_config:
    image_id: ami-ad3660c4 # 64-bit instance-store backed
    username: ubuntu
    ssh_key: ~/Users/markbate/.ec2/test-kitchen.pem

The following should work fine:

kitchen converge default-ec2-ubuntu-1204
kitchen login default-ec2-ubuntu-1204

If you set it a relative path:

- name: ec2-ubuntu-12.04
  driver_name: ec2
  driver_plugin: ec2
  driver_config:
    image_id: ami-ad3660c4 # 64-bit instance-store backed
    username: ubuntu
    ssh_key: ~/.ec2/test-kitchen.pem

The following will converge, but not login.

kitchen converge default-ec2-ubuntu-1204
kitchen login default-ec2-ubuntu-1204

Error message is:

Warning: Identity file ~/.ec2/test-kitchen.pem not accessible: No such file or directory.
Permission denied (publickey).

Tests should also work fine, it's just the login that doesn't expand the path.

@sethvargo
Copy link
Contributor

Marked this as a bug. It might be a TK issue, but paging @fnichol 😄.

@fnichol
Copy link
Contributor

fnichol commented Mar 17, 2014

Ah yes, this is something I need to fix/add for drivers, which was added to provisioners.

@sethvargo
Copy link
Contributor

Moved to test-kitchen/test-kitchen#389

@trinitronx
Copy link

Workaround for now:

  1. Run kitchen login -l debug
    D Login command: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -o LogLevel=VERBOSE -i ~/.ec2/test-kitchen.pem -p 22 ec2-user@ec2-123-456-789-01.compute-1.amazonaws.com (Options: {})
  2. Copy Login command
  3. Login manually:
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -o LogLevel=VERBOSE -i ~/.ec2/test-kitchen.pem -p 22 ec2-user@ec2-123-456-789-01.compute-1.amazonaws.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants