Difference between revisions of "RecoverSuperUserRights"

From Request Tracker Wiki
Jump to navigation Jump to search
m (2 revisions imported)
 
(No difference)

Latest revision as of 16:35, 6 April 2016

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"'