Class: Account
- Includes:
- DataMapper::Resource
- Defined in:
- lib/fabric/account.rb
Instance Method Summary collapse
Instance Method Details
#add_ssh_directory ⇒ Object
13 14 15 16 17 |
# File 'lib/fabric/account.rb', line 13 def add_ssh_directory self.server.execute_command("sudo mkdir #{self.user.ssh_config_directory_path}") self.server.execute_command("sudo chown #{self.user.name} #{user.ssh_config_directory_path}") self.server.execute_command("sudo chmod 700 #{self.user.ssh_config_directory_path}") end |
#add_to_groups ⇒ Object
25 26 27 |
# File 'lib/fabric/account.rb', line 25 def add_to_groups self.server.execute_command("sudo /usr/sbin/usermod -a -G #{self.user.groups.collect(&:name).join(',')} #{self.user.name}") end |
#add_user ⇒ Object
9 10 11 |
# File 'lib/fabric/account.rb', line 9 def add_user self.server.execute_command("sudo /usr/sbin/useradd -m #{self.user.name}") end |
#write_ssh_key ⇒ Object
19 20 21 22 23 |
# File 'lib/fabric/account.rb', line 19 def write_ssh_key self.server.execute_command("sudo touch #{self.user.}") self.server.execute_command("echo '#{self.user.}' | sudo tee #{self.user.}") self. end |