This is an unofficial info how to enable checking wheel group in GNU version of su command. This feature was never implemented in the official release because as stated by RMS himself it's "fascist" and was "misused" by people at MIT. FSF in their good will decided to protect system administrators from the free choice of using it. If you're however not concerned with RMS' views, here is how to implement this feature in GNU sh-utils-2.0:

  1. In su.c in main() fuction somewhere after pw_copy block and before if (!corret_password (pw)) add following:

    if (pw->pw_uid == 0 && wheel_test() == 0) 
      error (1, 0, _("not memeber of wheel group"));
    
    The error message can be anything.

  2. Somewhere within structure of su.c add wheel_test function:

    /* Return 1 if the current process (calling
    user) is a member of the wheel group.  */
    
    int
    wheel_test (void)
    {
      struct group *whgrp;
      gid_t grps[NGROUPS_MAX];
      int ngrps=0, grpn=0, match=0;
    
      whgrp = getgrnam("wheel");
      ngrps = getgroups(NGROUPS_MAX, (gid_t *) &grps);
      if(whgrp && ngrps)
        for(grpn=0; grpn<=ngrps; grpn++)
          if(grps[grpn]==whgrp->gr_gid)
            match=1;
    
      free(whgrp);
      return match;
    }
    
  3. You'll also need to include <grp.h>.

  4. Recompile, install & test.

WARNING: The code has billion bugs and trojan horses in it. Use at your own risk and responsibility.