class Gritano::Core::Key

Public Class Methods

authorized_keys() click to toggle source
# File lib/gritano/core/key.rb, line 11
def self.authorized_keys
  Key.all.map do |key|
    "command=\"gritano-remote #{key.user.login}\" #{key.key}"
  end.join("\n")
end

Public Instance Methods

update_authorized_keys() click to toggle source
# File lib/gritano/core/key.rb, line 6
def update_authorized_keys
  authorized_keys = File.join(Etc.getpwuid.dir, '.ssh/authorized_keys')
  File.open(authorized_keys, "w").write(Key.authorized_keys)
end