Class: Gritano::Core::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/gritano/core/key.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.authorized_keysObject



11
12
13
14
15
# File 'lib/gritano/core/key.rb', line 11

def self.authorized_keys
  Key.all.map do |key|
    "command=\"gritano-remote #{key.user.}\" #{key.key}"
  end.join("\n")
end

Instance Method Details

#update_authorized_keysObject



6
7
8
9
# 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