Sha256: 7b51ca5b927f5f3e41fbe3a86da548479bec96fbde812241bc918d733f9b00ab
Contents?: true
Size: 620 Bytes
Versions: 5
Compression:
Stored size: 620 Bytes
Contents
require "vagrant/util/shell_quote" module VagrantPlugins module GuestOpenBSD module Cap class InsertPublicKey def self.insert_public_key(machine, contents) contents = Vagrant::Util::ShellQuote.escape(contents, "'") contents = contents.gsub("\n", "\\n") machine.communicate.tap do |comm| comm.execute("mkdir -p ~/.ssh") comm.execute("chmod 0700 ~/.ssh") comm.execute("printf '#{contents}' >> ~/.ssh/authorized_keys") comm.execute("chmod 0600 ~/.ssh/authorized_keys") end end end end end end
Version data entries
5 entries across 2 versions & 2 rubygems