code: func (t *terminal) setOwner() error {
  	uid, gid, mode, err := getOwner(t.ctx.Identity.Login, user.Lookup, user.LookupGroup)
  	if err != nil {
  		return trace.Wrap(err)
  	}
  
  	err = os.Chown(t.tty.Name(), uid, gid)
  	if err != nil {
  		return trace.Wrap(err)
  	}
  	err = os.Chmod(t.tty.Name(), mode)
  	if err != nil {
  		return trace.Wrap(err)
  	}
  
  	log.Debugf("Set permissions on %v to %v:%v with mode %v.", t.tty.Name(), uid, gid, mode)
  
  	return nil
  }
docs: // setOwner changes the owner and mode of the TTY.