RecoverSuperUserRights

From Request Tracker Wiki
Jump to navigation Jump to search

The following one-liner uses the RT API and the internal RT::SystemUser to grant the root user the superuser safely. You'll need to run this as a local user that can access the RT config file.

perl -I/opt/rt3/lib -MRT -e'RT::LoadConfig; RT::Init;
  my $u=RT::User->new($RT::SystemUser);
  $u->Load("root");
  ($val,$msg) = $u->PrincipalObj->GrantRight(Object=> $RT::System, Right => "SuperUser");
  print "$msg\n"'