• Resolved rexgoode

    (@rexgoode)


    Because of brute force attacks, I have had to secure my WordPress installations better. The first thing I’ve done, after backing up databases, is to change the admin user name from “admin” to something else. On most of my installations, this is working. On one, I can no longer get into the network administration dashboard. I can get into the the dashboard for the one and only site currently created on the network, but the “My Sites” dropdown doesn’t show the Network item.

    When I try to go right to go directly to “http://www.mysite.org/wp-admin/network“, I get the old “You do not have sufficient permissions to access this page” error.

    I am using the subdomains option.

    I added a backtrace to wp_die so I could see more clearly what it was doing:

    #0 wp_die(You do not have sufficient permissions to access this page.)
    	called at [.../wp-admin/includes/menu.php:226] #1
     require_once(.../wp-admin/includes/menu.php)
    	called at [.../wp-admin/network/menu.php:63] #2
    require(.../wp-admin/network/menu.php)
    	called at [.../wp-admin/admin.php:102] #3
    require_once(.../wp-admin/admin.php)
    	called at [.../wp-admin/network/admin.php:13] #4 require_once(.../wp-admin/network/admin.php)
    	called at [.../wp-admin/network/index.php:11]
    
    You do not have sufficient permissions to access this page.

    In the user meta table, the wp_capabilities value is a:1:{s:13:”administrator”;s:1:”1″;} and wp_user_level is 10.

    My .htaccess file:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ wp/$1 [L]
    RewriteRule . index.php [L]

    Here is my redacted wp-config.php file:

    <?php
    // ** MySQL settings ** //
    define('DB_NAME', '...');    // The name of the database
    define('DB_USER', '...');     // Your MySQL username
    define('DB_PASSWORD', '...'); // ...and password
    define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');
    define('FTP_HOST', 'mysite.org');
    define('FTP_USER', '...');
    define('FTP_PASS', '...');
    
    // Change SECRET_KEY to a unique phrase.  You won't have to remember it later,
    // so make it long and complicated.  You can visit http://api.ww.wp.xz.cn/secret-key/1.0/
    // to get a secret key generated for you, or just make something up.
    define('SECRET_KEY', '...'); // Change this to a unique phrase.
    
    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!
    
    // Change this to localize WordPress.  A corresponding MO file for the
    // chosen language must be installed to wp-content/languages.
    // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', 'en-EN');
    
    define('WP_ALLOW_MULTISITE', TRUE);
    define('WP_TEMP_DIR',ABSPATH.'wp-content/tmp/');
    
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'mysite.org' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    define( 'AUTH_KEY', '...' );
    define( 'SECURE_AUTH_KEY', '...' );
    define( 'LOGGED_IN_KEY', '...' );
    define( 'NONCE_KEY', '...' );
    define( 'AUTH_SALT', '...' );
    define( 'SECURE_AUTH_SALT', '...' );
    define( 'LOGGED_IN_SALT', '...' );
    define( 'NONCE_SALT', '...x' );
    /* That's all, stop editing! Happy blogging. */
    
    require_once(ABSPATH.'wp-settings.php');
    ?>

    Even though it happened after changing my admin username, it may not be the cause. I was doing a lot of things to combat the attack. My host was about ready to turn me off permanently and refused to troubleshoot it with me.

    Help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p

    (@t-p)

    Changing the default username admin shouldn’t be difficult. Try:

    1. Create another administrator user
    2. Then login as new administrator user and delete “admin” user.

    There are also plugins. For example:

    http://ww.wp.xz.cn/plugins/admin-username-changer/

    Thread Starter rexgoode

    (@rexgoode)

    Tara, thanks. I tried your two steps. It didn’t work. The new administrator can’t log in at all. Gets the same error.

    Moderator t-p

    (@t-p)

    have you tried:

    -deactivating ALL plugins (yes, all) temporarily to see if this resolves the problem. If this works, re-activate them individually (one-by-one) to find the problematic plugin(s). If you can’t get into your admin dashboard, try deactivating via FTP or SFTP or whatever file management application your host provides. If applicible, also remember to deactivate any plugins in the mu-plugins folder. The easiest way is to rename that folder to mu-plugins-old.
    resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems (because the hooks remain unless plugins completely removed or some plugins stick around in cached files. So by renaming the folder, you break them and force them inactive).
    – To rule out any theme-specific issue, try switching to the unedited WP Twenty Ten default theme for a moment using the WP dashboard. If you don’t have access to your admin area, you can switch to the default theme by renaming your current theme’s folder in wp-content/themes and adding “-old” to the end of the folder name using via FTP or SFTP or whatever file management application your host provides.

    Thread Starter rexgoode

    (@rexgoode)

    Tara, thanks for sticking with me here. I just deactivated all plugins, moved them to a different directory. There isn’t a mu-plugins folder. I went back to Twenty Ten theme. Still same problem. I can log in as new admin, but he (I) can’t get to the network dashboard still.

    Moderator t-p

    (@t-p)

    I went back to Twenty Ten theme. Still same problem.

    have tried the default Twenty Twelve theme?

    Thread Starter rexgoode

    (@rexgoode)

    OK, I never figured out what was wrong, but I deleted everything in my wp-config.php between the WP_ALLOW_MULTISITE and the Happy Blogging comment. I exported all of my content. I deleted the database and created it empty. I went to the site and started fresh. Did the Network Setup and got new values for the wp-config.php and ran it again. Imported my content and I’m back in business.

    Tara, thanks for your great suggestions.

    Moderator t-p

    (@t-p)

    Glad you got it sorted. πŸ™‚

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Permissions problem after changing admin username’ is closed to new replies.