Method: Specinfra::Command::Base::User.check_has_authorized_key

Defined in:
lib/specinfra/command/base/user.rb

.check_has_authorized_key(user, key) ⇒ Object


28
29
30
31
# File 'lib/specinfra/command/base/user.rb', line 28

def check_has_authorized_key(user, key)
  key.sub!(/\s+\S*$/, '') if key.match(/^\S+\s+\S+\s+\S*$/)
  "grep -w -- #{escape(key)} ~#{escape(user)}/.ssh/authorized_keys"
end