# File lib/openshift-origin-node/model/unix_user.rb, line 252
    def add_ssh_key(key, key_type=nil, comment=nil)
      comment = "" unless comment
      self.class.notify_observers(:before_add_ssh_key, self, key)

      authorized_keys_file = File.join(@homedir, ".ssh", "authorized_keys")
      keys = read_ssh_keys authorized_keys_file
      key_type    = "ssh-rsa" if key_type.to_s.strip.length == 0

      # BZ 874594
      if @config.get("CLOUD_NAME")
        Syslog.alert "Setting CLOUD_NAME in #{OpenShift::Config::NODE_CONF_FILE} has no effect."
      end
      cloud_name  = "OPENSHIFT"

      ssh_comment = "#{cloud_name}-#{@uuid}#{comment}"
      shell       = @config.get("GEAR_SHELL") || "/bin/bash"
      cmd_entry   = "command=\"#{shell}\",no-X11-forwarding #{key_type} #{key} #{ssh_comment}"

      keys[ssh_comment] = cmd_entry
      write_ssh_keys authorized_keys_file, keys

      self.class.notify_observers(:after_add_ssh_key, self, key)
    end