Changed primary username in WHM now cpanel not working

krnlpanic

Member
Dec 28, 2019
7
0
1
USA
cPanel Access Level
Root Administrator
I am in the process of migrating off of a CentOS 6 VPS to a new CentOS 7 VPS (there's a whole separate discussion topic about IBM/RedHat and CentOS Stream for another time!). Anyway - when my new VPS was created, I received an auto-generated, eight-character username based on the primary domain for my account, which I assume is standard practice. I don't like that username and would prefer to administer my domains as a different user.

So, I logged into WHM and found where to change the primary account username, and made the change. It all appeared to work correctly - home directory was created, etc. But now, as I attempt to create add-on domains through the BlueHost cpanel interface, it doesn't recognize the username change that I made in WHM, and I get an error.

What do I need to do in order to make the preferred username propagate throughout all aspects of WHM and cPanel?
 

andrew.n

Well-Known Member
Jun 9, 2020
581
158
43
EU
cPanel Access Level
Root Administrator
This should be something unique to BlueHost. Do you have root access to the old and the new server? How does this process exactly look like? Do you just press a button to migrate and they will provision a new VPS and with some scripting migrate all your accounts and provide you the new details?

Please tell us a bit more with possible screenshots because at least for me it's not clear what's happening atm.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
5,465
698
313
cPanel Access Level
Root Administrator
I agree with @andrew.n - I can't tell from your initial description what work you are trying to perform. If you can let us know the specific page you see the error (such as cPanel >> Addon Domains or something similar) and what the error is, I may be able to get you better information.
 

krnlpanic

Member
Dec 28, 2019
7
0
1
USA
cPanel Access Level
Root Administrator
Old and new systems are both VPS and I have root access to each. The migration process has been painstaking, as I have several phpbb forums and a couple of OSCommerce-based shopping carts, so upgrading everything to be compatible with PHP 7.1 (was php 5.6) has been a 2-week domain-by-domain effort chasing down and patching issues (mostly updating to use mysqli).

So, specifically to the question here - I had them spin up a new CentOS 7 VPS server with 2 CPU and 4GB RAM. My primary domain is krnlpanic.com. When they instantiated cpanel in the new server, it created the main user 'krnlpani'. I don't like that username, and preferred to change it to krnl. When I executed this change (attached WHM_username.png), the system deleted /home/krnlpani and created /home/krnl (andcreated /var/cpanel/users/krnl). Everything looked great, so I set off to moving my domains across and working the compatibility issues.

Now I have most of my domains moved over, with all of my virtual hosts manually added to the apache conf.d include directory, and I want to start setting each domain up as an add-on domain. When I go to create the add-on domain in the Bluehost cpanel front-end (attached bluehost_cpanel.png), it errors out because cpanel wants to create the add-on domain in /home/krnlpani/public_html instead of where I have everything set up. Bluehost insists that the only way I can make this work is for me to revert back to the system-generated main username - krnlpani.

Hopefully that makes sense? I know I'm doing things a little backward, as I'm an old command-line kind of guy, so using cpanel scripts to create domains and such for me is a little foreign, but I'm trying to get used to it and use it to simplify my workload.

I suppose I could switch everything back over to the system-generated username and create a new user, then implement all of my domains under the new user, but that's kind of annoying since I'm not reselling, this is the only server I manage, and I just want to get all of my domains up and operational.

What are your thoughts?
 

Attachments

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
5,465
698
313
cPanel Access Level
Root Administrator
Thanks for the additional details, and for being so thorough. In this case, that's all on the Bluehost side so I don't have additional thoughts as cPanel doesn't have any control over the second screenshot you've provided. From what you're saying you've done everything correctly, but something is not integrating properly with the Bluehost tools.

Can you contact them and see what they have to say?
 

andrew.n

Well-Known Member
Jun 9, 2020
581
158
43
EU
cPanel Access Level
Root Administrator
Well since you have root access and you can access WHM I would just forget BlueHost control panel completely. Working inside WHM it's easy, straightforward and this way you "directly" make all the changes on the server rather than through another front-end layer which is only causing issues. Additionally if you decide to change providers in the future only what you see inside WHM will matter and not what is in BlueHost panel.
 
  • Like
Reactions: cPRex

krnlpanic

Member
Dec 28, 2019
7
0
1
USA
cPanel Access Level
Root Administrator
I'm all good from the httpd and mysql perspectives. I'm trying to get my domains happy with exim at the moment and the only way I've managed to get that to work in the past is to add them as add-on domains. I guess that's probably a separate thread, though.

I feel like I should be able to add a user from the CLI and that exim should handle mail for that user at any domain that resolves to my ip. Doesn't seem to be working that way. Fighting with /etc/maildomains and all the other...
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
5,465
698
313
cPanel Access Level
Root Administrator
I'm not totally clear on your last issue there - when you create a cPanel user, that also creates all the necessary tools for email to work with that domain. It isn't related to IP addresses, but with the domain name itself.

/etc/maildomains is also not a file that is normally present on a cPanel machine.

Can you get me more specifics on that mail issue?
 

krnlpanic

Member
Dec 28, 2019
7
0
1
USA
cPanel Access Level
Root Administrator
okay - I have the following configuration all using the same IP address:

server.krnlpanic.com (primary hostname A record)
krnlpanic.com (A record)
mail.krnlpanic.com (A record)

domain2.com (A record) MX record pointing to mail.krnlpanic.com
domain3.com (A record) MX record pointing to mail.krnlpanic.com

I would expect that if I created an account called 'user1' I should be able to email [email protected] but I get 550 - Unrouteable Address

I have added domain2.com and domain3.com to the file /etc/localdomains and restarted exim
 

krnlpanic

Member
Dec 28, 2019
7
0
1
USA
cPanel Access Level
Root Administrator
I found a workaround to login to the real cpanel on my domain instead of the bluehost rehosted cpanel front-end by going through a link in WHM under Reseller Center. Added all of my domains as Addon Domains through that interface (initially had an error because I manage my DNS remotely, so had to add my DNS IPs to /etc/ips.remotedns). The creation of my domains as Addon Domains under the account added all of my domains to httpd.conf, /etc/userdomains, /etc/userdatadomains/, created DNS records, and probably a few other things that I'm unaware of. Now, at least, I am able to receive email for all of my domains. Both users are being redirected to the primary user though (even though there's no alias for that user in /etc/aliases), so still need to work that out.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
5,465
698
313
cPanel Access Level
Root Administrator
That sounds like an issue with the default address configuration. If you go to cPanel >> Default Address under the Email section, I'd recommend making sure the value is set to "Discard the email while your server processes it by SMTP time with an error message" to ensure the mails do not get delivered. Can you check that setting?