From f7f46ba47de40905a92884923780e5cbca9790b2 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 15 Jun 2016 23:56:22 +0100 Subject: [PATCH] Append newline to each key added The change to this file 10 days ago removed a newline character at the end of each key added to it. This mean that when another key was added, it continued on the same line as the one before and thus wasn't being detected when an ssh connection came in with a key file. With regards to https://github.com/mitchellh/vagrant/issues/7455 this is an (ugly) fix. I'm sure someone knows a better command to concat a file and a string and append it to the `authorized_keys` file. But this does fix the problem. --- plugins/guests/linux/cap/insert_public_key.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/guests/linux/cap/insert_public_key.rb b/plugins/guests/linux/cap/insert_public_key.rb index b7335bdc5..8fee49a12 100644 --- a/plugins/guests/linux/cap/insert_public_key.rb +++ b/plugins/guests/linux/cap/insert_public_key.rb @@ -19,6 +19,7 @@ module VagrantPlugins mkdir -p ~/.ssh chmod 0700 ~/.ssh cat '#{remote_path}' >> ~/.ssh/authorized_keys + echo "\n" >> ~/.ssh/authorized_keys chmod 0600 ~/.ssh/authorized_keys # Remove the temporary file