code: func getOwner(login string, lookupUser LookupUser, lookupGroup LookupGroup) (int, int, os.FileMode, error) {
  	var err error
  	var uid int
  	var gid int
  	var mode os.FileMode
  
  	// Lookup the Unix login for the UID and fallback GID.
  	u, err := lookupUser(login)
  	if err != nil {
  		return 0, 0, 0, trace.Wrap(err)
  	}
  	uid, err = strconv.Atoi(u.Uid)
  	if err != nil {
  		return 0, 0, 0, trace.Wrap(err)
  	}
  
  	// If the tty group exists, use that as the gid of the TTY and set mode to
  	// be u+rw. Otherwise use the group of the user with mode u+rw g+w.
  	group, err := lookupGroup("tty")
  	if err != nil {
  		gid, err = strconv.Atoi(u.Gid)
  		if err != nil {
  			return 0, 0, 0, trace.Wrap(err)
  		}
  		mode = 0620
  	} else {
  		gid, err = strconv.Atoi(group.Gid)
  		if err != nil {
  			return 0, 0, 0, trace.Wrap(err)
  		}
  		mode = 0600
  	}
  
  	return uid, gid, mode, nil
  }
docs: // getOwner determines the uid, gid, and mode of the TTY similar to OpenSSH:
  // https://github.com/openssh/openssh-portable/blob/ddc0f38/sshpty.c#L164-L215