Difference between revisions of "software/Mastodon/admin/dethrone"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< software‎ | Mastodon‎ | admin
Jump to navigation Jump to search
(a necessary page)
 
m (Woozle moved page Mastodon/admin/dethrone to software/Mastodon/admin/dethrone: disambiguate from band (eventually))
 
(No difference)

Latest revision as of 19:12, 12 March 2025

How to dethrone an admin (i.e. remove their admin privileges):

Proper Method

As $mastodon_user, run the Rails console:

  • cd <mastodon_folder>
  • bundle exec rails c
  • Account.find_local('<admin_account_name>').user.update(admin: false)

I haven't used this successfully, but am told that it works.

Brute Force

Execute the following SQL on the applicable Mastodon database:

SELECT * FROM users WHERE admin;

This will get you a list of admins, from which you can get the account_id of the one you want to dethrone. Then execute this:

UPDATE users SET admin=FALSE WHERE account_id = {id to dethrone}

Links