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