# File lib/fog/aws/models/compute/server.rb, line 191 def setup(credentials = {}) requires :public_ip_address, :username require 'net/ssh' commands = [ %{mkdir .ssh}, %{passwd -l #{username}}, %{echo "#{Fog::JSON.encode(Fog::JSON.sanitize(attributes))}" >> ~/attributes.json} ] if public_key commands << %{echo "#{public_key}" >> ~/.ssh/authorized_keys} end # wait for aws to be ready wait_for { sshable? } Fog::SSH.new(public_ip_address, username, credentials).run(commands) end