Class: User

Inherits:
Object show all
Includes:
DataMapper::Resource
Defined in:
lib/fabric/user.rb

Instance Method Summary collapse

Instance Method Details

#authorized_keys_fileObject



13
14
15
16
17
18
19
20
# File 'lib/fabric/user.rb', line 13

def authorized_keys_file
  authorized_keys = self.keys.inject('') do |authorized_keys, key|
    authorized_keys << key.public_key
  end
  
  raise "User #{self.name} has a blank SSH key - this is not permitted" if authorized_keys.blank?
  authorized_keys  
end

#authorized_keys_file_pathObject



22
23
24
# File 'lib/fabric/user.rb', line 22

def authorized_keys_file_path
  "/home/#{self.name}/.ssh/authorized_keys"
end

#home_directory_pathObject



26
27
28
# File 'lib/fabric/user.rb', line 26

def home_directory_path
  "/home/#{self.name}/"
end

#ssh_config_directory_pathObject



30
31
32
# File 'lib/fabric/user.rb', line 30

def ssh_config_directory_path
  "/home/#{self.name}/.ssh/"
end