{"action":"created","issue":{"url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/398","repository_url":"https://api.github.com/repos/test-kitchen/kitchen-ec2","labels_url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/398/labels{/name}","comments_url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/398/comments","events_url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/398/events","html_url":"https://github.com/test-kitchen/kitchen-ec2/issues/398","id":320829549,"number":398,"title":"SSH access failing to EC2 instance through kitchen","user":{"login":"saidmasoud","id":23317181,"avatar_url":"https://avatars2.githubusercontent.com/u/23317181?v=4","gravatar_id":"","url":"https://api.github.com/users/saidmasoud","html_url":"https://github.com/saidmasoud","followers_url":"https://api.github.com/users/saidmasoud/followers","following_url":"https://api.github.com/users/saidmasoud/following{/other_user}","gists_url":"https://api.github.com/users/saidmasoud/gists{/gist_id}","starred_url":"https://api.github.com/users/saidmasoud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saidmasoud/subscriptions","organizations_url":"https://api.github.com/users/saidmasoud/orgs","repos_url":"https://api.github.com/users/saidmasoud/repos","events_url":"https://api.github.com/users/saidmasoud/events{/privacy}","received_events_url":"https://api.github.com/users/saidmasoud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-05-07T14:37:30Z","updated_at":"2018-05-08T19:00:16Z","closed_at":null,"author_association":"NONE","body":"OS: macOS 10.12.4\r\n\r\nWhen creating an EC2 instance via `kitchen`, I cannot SSH into the host. I can, however, manually SSH into the host on the command line. I have looked up previously related issues in this repo, and none of the solutions listed helped me out. My `~/.ssh/config` file has nothing special in it.\r\n\r\nSoftware versions:\r\n\r\n- Chef Development Kit Version: 2.5.3\r\n- chef-client version: 13.8.5\r\n- delivery version: master (73ebb72a6c42b3d2ff5370c476be800fee7e5427)\r\n- berks version: 6.3.1\r\n- kitchen version: 1.20.0\r\n- inspec version: 1.51.21\r\n- kitchen-ec2 (2.2.1)\r\n\r\n`.kitchen.yml`:\r\n\r\n```\r\n---\r\ndriver:\r\n  name: ec2\r\n  aws_ssh_key_id: kubernetes.dev.example.com-36:e8:0a:34:0a:e8:86:68:37:1f:52:53:1e:1b:91:bd\r\n  security_group_ids: sg-91e8f2fa\r\n  region: us-east-2\r\n  availability_zone: b\r\n  subnet_id: subnet-478d283d\r\n  instance_type: t2.micro\r\n  associate_public_ip: true\r\n  interface: dns\r\n\r\ntransport:\r\n  ssh_key: /Users/said/Downloads/dev-fluentd.pem\r\n  username: admin\r\n\r\nprovisioner:\r\n  name: chef_zero\r\n  # You may wish to disable always updating cookbooks in CI or other testing environments.\r\n  # For example:\r\n  #   always_update_cookbooks: <%= !ENV['CI'] %>\r\n  always_update_cookbooks: true\r\n\r\nverifier:\r\n  name: inspec\r\n\r\nplatforms:\r\n  - name: debian-k8s\r\n    driver:\r\n      image_id: ami-a45064c1 #Default kops image\r\n    transport:\r\n      username: admin\r\n\r\n\r\nsuites:\r\n  - name: default\r\n    run_list:\r\n      - recipe[kops-nodes::default]\r\n    verifier:\r\n      inspec_tests:\r\n        - test/integration/default\r\n    attributes:\r\n```\r\n\r\n`kitchen create` output:\r\n\r\n```\r\n-----> Starting Kitchen (v1.20.0)\r\n-----> Creating <default-debian-k8s>...\r\n       Detected platform: debian version 1 on x86_64. Instance Type: t2.micro. Default username: admin (default).\r\n       If you are not using an account that qualifies under the AWS\r\nfree-tier, you may be charged to run these suites. The charge\r\nshould be minimal, but neither Test Kitchen nor its maintainers\r\nare responsible for your incurred costs.\r\n\r\n       Instance <i-0377cbb72560e6e7d> requested.\r\n       Polling AWS for existence, attempt 0...\r\n       Attempting to tag the instance, 0 retries\r\n       EC2 instance <i-0377cbb72560e6e7d> created.\r\n       Waited 0/300s for instance <i-0377cbb72560e6e7d> volumes to be ready.\r\n       Waited 0/300s for instance <i-0377cbb72560e6e7d> to become ready.\r\n       Waited 5/300s for instance <i-0377cbb72560e6e7d> to become ready.\r\n       Waited 10/300s for instance <i-0377cbb72560e6e7d> to become ready.\r\n       Waited 15/300s for instance <i-0377cbb72560e6e7d> to become ready.\r\n       Waited 20/300s for instance <i-0377cbb72560e6e7d> to become ready.\r\n       EC2 instance <i-0377cbb72560e6e7d> ready (hostname: ec2-18-216-126-50.us-east-2.compute.amazonaws.com).\r\n       Waiting for SSH service on ec2-18-216-126-50.us-east-2.compute.amazonaws.com:22, retrying in 3 seconds\r\n       Waiting for SSH service on ec2-18-216-126-50.us-east-2.compute.amazonaws.com:22, retrying in 3 seconds\r\n       Waiting for SSH service on ec2-18-216-126-50.us-east-2.compute.amazonaws.com:22, retrying in 3 seconds\r\n       Waiting for SSH service on ec2-18-216-126-50.us-east-2.compute.amazonaws.com:22, retrying in 3 seconds\r\n       Waiting for SSH service on ec2-18-216-126-50.us-east-2.compute.amazonaws.com:22, retrying in 3 seconds\r\n```\r\n\r\n`kitchen converge` output:\r\n\r\n```\r\n-----> Starting Kitchen (v1.20.0)\r\n-----> Creating <default-debian-k8s>...\r\n       Finished creating <default-debian-k8s> (0m0.00s).\r\n-----> Converging <default-debian-k8s>...\r\n       Preparing files for transfer\r\n       Preparing dna.json\r\n       Resolving cookbook dependencies with Berkshelf 6.3.1...\r\n       Removing non-cookbook files before transfer\r\n       Preparing validation.pem\r\n       Preparing client.rb\r\n       [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user admin@ec2-18-216-126-50.us-east-2.compute.amazonaws.com>)\r\n       [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user admin@ec2-18-216-126-50.us-east-2.compute.amazonaws.com>)\r\n       [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user admin@ec2-18-216-126-50.us-east-2.compute.amazonaws.com>)\r\n       [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user admin@ec2-18-216-126-50.us-east-2.compute.amazonaws.com>)\r\n$$$$$$ [SSH] connection failed, terminating (#<Net::SSH::AuthenticationFailed: Authentication failed for user admin@ec2-18-216-126-50.us-east-2.compute.amazonaws.com>)\r\n>>>>>> ------Exception-------\r\n>>>>>> Class: Kitchen::ActionFailed\r\n>>>>>> Message: 1 actions failed.\r\n>>>>>>     Converge failed on instance <default-debian-k8s>.  Please see .kitchen/logs/default-debian-k8s.log for more details\r\n>>>>>> ----------------------\r\n>>>>>> Please see .kitchen/logs/kitchen.log for more details\r\n>>>>>> Also try running `kitchen diagnose --all` for configuration\r\n```\r\n\r\n`/.ssh/config`:\r\n```\r\nHost *\r\n AddKeysToAgent yes\r\n UseKeychain yes\r\n IdentityFile ~/.ssh/id_rsa\r\n```\r\n\r\nManual SSH attempt:\r\n\r\n```\r\n$ ssh -i ~/Downloads/dev-fluentd.pem admin@ec2-18-216-126-50.us-east-2.compute.amazonaws.com\r\nThe authenticity of host 'ec2-18-216-126-50.us-east-2.compute.amazonaws.com (18.216.126.50)' can't be established.\r\nECDSA key fingerprint is SHA256:/SiX/f6gGJATCJbpWZqVNZBzJcWTxKPMeN8ubfHSp3o.\r\nAre you sure you want to continue connecting (yes/no)? yes\r\nWarning: Permanently added 'ec2-18-216-126-50.us-east-2.compute.amazonaws.com,18.216.126.50' (ECDSA) to the list of known hosts.\r\n\r\nThe programs included with the Debian GNU/Linux system are free software;\r\nthe exact distribution terms for each program are described in the\r\nindividual files in /usr/share/doc/*/copyright.\r\n\r\nDebian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent\r\npermitted by applicable law.\r\nadmin@ip-172-20-39-233:~$\r\n```"},"comment":{"url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/comments/387507449","html_url":"https://github.com/test-kitchen/kitchen-ec2/issues/398#issuecomment-387507449","issue_url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/398","id":387507449,"user":{"login":"saidmasoud","id":23317181,"avatar_url":"https://avatars2.githubusercontent.com/u/23317181?v=4","gravatar_id":"","url":"https://api.github.com/users/saidmasoud","html_url":"https://github.com/saidmasoud","followers_url":"https://api.github.com/users/saidmasoud/followers","following_url":"https://api.github.com/users/saidmasoud/following{/other_user}","gists_url":"https://api.github.com/users/saidmasoud/gists{/gist_id}","starred_url":"https://api.github.com/users/saidmasoud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saidmasoud/subscriptions","organizations_url":"https://api.github.com/users/saidmasoud/orgs","repos_url":"https://api.github.com/users/saidmasoud/repos","events_url":"https://api.github.com/users/saidmasoud/events{/privacy}","received_events_url":"https://api.github.com/users/saidmasoud/received_events","type":"User","site_admin":false},"created_at":"2018-05-08T19:00:16Z","updated_at":"2018-05-08T19:00:16Z","author_association":"NONE","body":"@coderanger is this what you're looking for? The key was generated in AWS EC2 by `kops`:\r\n\r\n```\r\n$ openssl rsa -text -noout -in ~/Downloads/dev-fluentd.pem\r\nPrivate-Key: (2048 bit)\r\n<REDACTED>\r\n```"}}
{"actor":{"display_login":"saidmasoud"}}