{"action":"created","issue":{"url":"https://api.github.com/repos/roots/trellis/issues/348","labels_url":"https://api.github.com/repos/roots/trellis/issues/348/labels{/name}","comments_url":"https://api.github.com/repos/roots/trellis/issues/348/comments","events_url":"https://api.github.com/repos/roots/trellis/issues/348/events","html_url":"https://github.com/roots/trellis/issues/348","id":105905169,"number":348,"title":"Issue with `vagrant ssh` after creating new vm","user":{"login":"redconfetti","id":746759,"avatar_url":"https://avatars.githubusercontent.com/u/746759?v=3","gravatar_id":"","url":"https://api.github.com/users/redconfetti","html_url":"https://github.com/redconfetti","followers_url":"https://api.github.com/users/redconfetti/followers","following_url":"https://api.github.com/users/redconfetti/following{/other_user}","gists_url":"https://api.github.com/users/redconfetti/gists{/gist_id}","starred_url":"https://api.github.com/users/redconfetti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redconfetti/subscriptions","organizations_url":"https://api.github.com/users/redconfetti/orgs","repos_url":"https://api.github.com/users/redconfetti/repos","events_url":"https://api.github.com/users/redconfetti/events{/privacy}","received_events_url":"https://api.github.com/users/redconfetti/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-10T21:52:12Z","updated_at":"2015-09-10T22:01:40Z","closed_at":null,"body":"I'm running into an issue when running `vagrant ssh` immediately after running `vagrant up`. I'm using Trellis with a Bedrock site.\r\n\r\n```\r\n$ vagrant ssh\r\nssh_exchange_identification: Connection closed by remote host\r\n```\r\n\r\nWhen modifying dev.yml to only include the 'sshd' role, this issue still persists. When I comment out the 'sshd' role, the issue is resolved.\r\n\r\n```\r\n$ vagrant ssh -- -vvv\r\n$ vagrant ssh -- -vvv\r\nOpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011\r\ndebug1: Reading configuration data /Users/myuser/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh_config\r\ndebug1: /etc/ssh_config line 20: Applying options for *\r\ndebug1: /etc/ssh_config line 102: Applying options for *\r\ndebug2: ssh_connect: needpriv 0\r\ndebug1: Connecting to 127.0.0.1 [127.0.0.1] port 2222.\r\ndebug1: Connection established.\r\ndebug3: Incorrect RSA1 identifier\r\ndebug3: Could not load \"/Users/myuser/Projects/myproject/.vagrant/machines/default/virtualbox/private_key\" as a RSA1 public key\r\ndebug1: identity file /Users/myuser/Projects/myproject/.vagrant/machines/default/virtualbox/private_key type -1\r\ndebug1: identity file /Users/myuser/Projects/myproject/.vagrant/machines/default/virtualbox/private_key-cert type -1\r\ndebug1: Enabling compatibility mode for protocol 2.0\r\ndebug1: Local version string SSH-2.0-OpenSSH_6.2\r\nssh_exchange_identification: Connection closed by remote host\r\n```\r\n\r\nOnly when I do allow the 'users' role to establish my public key in the VM does the following command work. Using the public key that Vagrant establishes with 127.0.0.1 doesn't work though.\r\n\r\n```bash\r\n$ ssh vagrant@192.168.50.5 -p 2222\r\n```\r\n\r\nI'm still trying to narrow down the cause of this issue. The /etc/sshd_config that is generated isn't different than the default configuration that is put in place when the 'sshd' role is applied. But certainly when I apply the changes, I'm locked out. When I remove them and rebuild the VM, `vagrant ssh` works fine.\r\n"},"comment":{"url":"https://api.github.com/repos/roots/trellis/issues/comments/139394334","html_url":"https://github.com/roots/trellis/issues/348#issuecomment-139394334","issue_url":"https://api.github.com/repos/roots/trellis/issues/348","id":139394334,"user":{"login":"redconfetti","id":746759,"avatar_url":"https://avatars.githubusercontent.com/u/746759?v=3","gravatar_id":"","url":"https://api.github.com/users/redconfetti","html_url":"https://github.com/redconfetti","followers_url":"https://api.github.com/users/redconfetti/followers","following_url":"https://api.github.com/users/redconfetti/following{/other_user}","gists_url":"https://api.github.com/users/redconfetti/gists{/gist_id}","starred_url":"https://api.github.com/users/redconfetti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redconfetti/subscriptions","organizations_url":"https://api.github.com/users/redconfetti/orgs","repos_url":"https://api.github.com/users/redconfetti/repos","events_url":"https://api.github.com/users/redconfetti/events{/privacy}","received_events_url":"https://api.github.com/users/redconfetti/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T22:01:40Z","updated_at":"2015-09-10T22:01:40Z","body":"I think I just discovered the discrepancy.\r\n\r\n```\r\n$ vagrant ssh -- -v\r\nOpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011\r\ndebug1: Reading configuration data /Users/redconfetti/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh_config\r\ndebug1: /etc/ssh_config line 20: Applying options for *\r\ndebug1: /etc/ssh_config line 102: Applying options for *\r\ndebug1: Connecting to 127.0.0.1 [127.0.0.1] port 2200.\r\n```\r\n\r\nIt's using port 2200 when the 'sshd' role isn't applied. With the role applied, `vagrant ssh` attempts to use port 2222. I noticed that during the build that isn't failing it includes:\r\n\r\n```\r\n==> default: Clearing any previously set forwarded ports...\r\n==> default: Fixed port collision for 22 => 2222. Now on port 2200.\r\n```\r\n\r\nPerhaps there is some sort of port issue, collision with Mac OS X."}}