{"action":"created","issue":{"url":"https://api.github.com/repos/mitchellh/vagrant/issues/5881","labels_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5881/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5881/comments","events_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5881/events","html_url":"https://github.com/mitchellh/vagrant/issues/5881","id":92129836,"number":5881,"title":"insert_public_key on OpenBSD lacks newline","user":{"login":"double-p","id":1552251,"avatar_url":"https://avatars.githubusercontent.com/u/1552251?v=3","gravatar_id":"","url":"https://api.github.com/users/double-p","html_url":"https://github.com/double-p","followers_url":"https://api.github.com/users/double-p/followers","following_url":"https://api.github.com/users/double-p/following{/other_user}","gists_url":"https://api.github.com/users/double-p/gists{/gist_id}","starred_url":"https://api.github.com/users/double-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/double-p/subscriptions","organizations_url":"https://api.github.com/users/double-p/orgs","repos_url":"https://api.github.com/users/double-p/repos","events_url":"https://api.github.com/users/double-p/events{/privacy}","received_events_url":"https://api.github.com/users/double-p/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mitchellh/vagrant/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/mitchellh/vagrant/labels/core","name":"core","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-30T15:51:32Z","updated_at":"2015-08-18T15:55:05Z","closed_at":"2015-07-06T00:10:33Z","body":"The current code might leave in a situation like this in ~vagrant/.ssh/authorized_keys:\r\n```\r\nssh-rsa existingkey commentssh-rsa newkey vagrant\r\n```\r\ninstead of\r\n```\r\nssh-rsa existingkey comment\r\nssh-rsa newkey vagrant\r\n```\r\nSince sshd considers empty lines as comments, a leading `\\n` in the printf helps.\r\n\r\nVagrant-1.7.2 on OSX10.10 / OpenBSD5.8-current (guest OS is detected properly)\r\nconfig.ssh.shell = \"ksh -l\"\r\n\r\nLog:\r\n```\r\nDEBUG ssh: Re-using SSH connection.\r\n INFO ssh: Execute: printf 'ssh-rsa AAAAB....Bd02R vagrant' >> ~/.ssh/authorized_keys (sudo=false)\r\nDEBUG ssh: Exit status: 0\r\n```"},"comment":{"url":"https://api.github.com/repos/mitchellh/vagrant/issues/comments/132257637","html_url":"https://github.com/mitchellh/vagrant/issues/5881#issuecomment-132257637","issue_url":"https://api.github.com/repos/mitchellh/vagrant/issues/5881","id":132257637,"user":{"login":"double-p","id":1552251,"avatar_url":"https://avatars.githubusercontent.com/u/1552251?v=3","gravatar_id":"","url":"https://api.github.com/users/double-p","html_url":"https://github.com/double-p","followers_url":"https://api.github.com/users/double-p/followers","following_url":"https://api.github.com/users/double-p/following{/other_user}","gists_url":"https://api.github.com/users/double-p/gists{/gist_id}","starred_url":"https://api.github.com/users/double-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/double-p/subscriptions","organizations_url":"https://api.github.com/users/double-p/orgs","repos_url":"https://api.github.com/users/double-p/repos","events_url":"https://api.github.com/users/double-p/events{/privacy}","received_events_url":"https://api.github.com/users/double-p/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T15:55:05Z","updated_at":"2015-08-18T15:55:05Z","body":"actually the newline must be in the beginning, as in before printing the key-string."}}