Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
T

TechSpan

@TechSpan
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Lost access to Wordpress
    T TechSpan

    On my Cloudron-powered WordPress website I have made a solution. Simply open your Cloudron UI and access the Terminal.

    dbname=`head -20 wp-config.php | grep 'NAME' | cut -d\' -f4`
    dbuser=`head -20 wp-config.php | grep 'USER' | cut -d\' -f4`
    dbpass=`head -20 wp-config.php | grep 'PASS' | cut -d\' -f4`
    dbhost=`head -20 wp-config.php|grep 'HOST'|cut -d\' -f4|cut -d: -f1`
    mysql -h $dbhost -u $dbuser -p$dbpass -D $dbname -e "insert into wp_users (user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name) values ('emergency','','emergency','emergency@localhost','','2023-01-10 01:23','',0,'Emergency');set @emerid = (SELECT ID FROM wp_users WHERE user_email = 'emergency@localhost');insert into wp_usermeta (user_id, meta_key, meta_value) values (@emerid, 'wp_capabilities', 'a:1:{s:13:\"administrator\";b:1;} ');UPDATE wp_users SET user_pass=\"582f40dea63ec71c7f12d8adbe3230b4\" WHERE ID = @emerid;"
    

    This should inject a user:
    emergency

    With password:
    techspanHelpsy0u#

    Obviously change the username/password to your own liking prior to pasting in the commands. The password is in MD5 hash format, so just use an "md5 generator" and then where you see 582f40dea63ec71c7f12d8adbe3230b4...... put your own password MD5 hash, hint: Google MD5 hash generator and then type your_wanted_password, generate the hash, and replace!

    If you have any issues, or find this works - either way please let me know so I can help improve this copy paste solution

    Side-note one could set a variable of a preferred password by the user, then use md5sum to generate said md5 hash to pass through to the SQL.

    However, all that said - the wp cli solution does all this for you.

    wp user create wild wild@localhost.0000000 --role=administrator
    

    This would generate a user wild with a randomly generated password which would display on the terminal output.

    WordPress (Managed)
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search