Sha256: c4afdce626d06d34b443e052906abd8754bfc957f0c1b8f3646f2a6f0bd0bea1
Contents?: true
Size: 613 Bytes
Versions: 25
Compression:
Stored size: 613 Bytes
Contents
require "vagrant/util/shell_quote" module VagrantPlugins module GuestSolaris11 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
25 entries across 22 versions & 4 rubygems