Restrict access to Control Panel DA

Cyril BwN

New member
Joined
Feb 16, 2024
Messages
6
Location
France
Hello to the DirectAdmin Community,
I am a new user of DA. I've been getting my bearings on a VPS for a few days now. The panel is great, I just have a small question concerning access to the Control Panel.
When I add a new domain and a website, everything works fine, but I've just noticed that you can access the Control Panel login by entering domainname.com:XXXX (XXXX is the custom port I created following Forum advice).
I'd like the sites I add not to have this option. I'd like to be able to connect to the Control Panel only via the server's subdomain.
Is this possible and how do I go about it ?
Best regards.
Cyril
 
Can anyone help me ?
You could try to look in the docs.

The use the search function on the upper right hand and lots of things are already present in the docs.

This one can maybe be found a little bit more difficult to find, however, try by setting this in your directadmin.conf file:
force_hostname=your.hostname.com
and restart directadmin afterwards.

Ofcourse change the value to your own hostname.
 
Hello Richard,

Thank you very much for your reply. It's very kind of you to help me.

Of course I've already tried looking in the docs and the forum but I can't find the answer to my problem.

For "force_hostname" in the directadmin.conf file I've already done it, it's great, it allows you to connect to DirectAdmin with the server sub-domain and not with the IP.

However, it doesn't solve my problem because when someone types websitedomain.com:XXXX, they're redirected to the server's sub-domain.

In fact, I don't want anyone to be able to access the DirectAdmin control panel connection from a website. Only if you know the address of this sub-domain.
I'd like the administration part of the server (DirectAdmin) to be reserved for the sub-domain and for each published site to be independent.

Best regards.
Cyril
 
Hello jamgames2,

Port 2222 is already closed, I removed it from CSF and modified the directadmin.conf.
You can only connect with a custom port number, that's fine.

However, if anyone writes this custom port at the end of a website hosted on the server, it is redirected to the sub-domain of the DirectAdmin Control Panel.

When you say "use nginx or apache to access panel instead", what are you referring to ?

All the best.
 
It's in the link.

close all port that can connect to directadmin panel ( :2222 ), so no one can connect to your panel unless access with your sub.domain that's config in nginx or apache.
 
Hi jamgames2,

I will test this tomorrow and let you know. Maybe you found the solution to my problem. I'll dive back into the doc.

I'll keep my fingers crossed.

Thanks for the advice jamgames2.
Cyril
 
Back
Top