How to create a one-time login hash URL in DirectAdmin

One-time login URLs function allows you to generate an URL that will login the user automatically. By default, the URL is valid for 3 days. You can change this interval and other options via the command line options.

The command to generate the one-time login URL is:

# /usr/local/directadmin/directadmin --create-login-url user=USERNAME

where the USERNAME is the DirectAdmin username you want to create the URL for.

An example of output of the command for user admin is:

[root@web ~]# /usr/local/directadmin/directadmin --create-login-url user=admin
[root@web ~]#

Now, copy/paste the URL in your preferred web browser.

To change the default 3 days validity period, use:

# /usr/local/directadmin/directadmin --create-login-url expiry=[s,m,h,d,M,y] user=USERNAME

The following example will create an URL valid for one hour:

# /usr/local/directadmin/directadmin --create-login-url expiry=1h user=admin

To limit the URL to a specific IP, use the ips option in the command:

# /usr/local/directadmin/directadmin --create-login-url ips=IP1,IP2 user=USERNAME

Example that will allow the URL to be used on only one IP:

# /usr/local/directadmin/directadmin --create-login-url ips= user=admin
directadmin logo
DirectAdmin Logo

One-Time Login Hash URL

Leave a Reply