Managing Login Keys in DirectAdmin
Summary
This guide explains how to create and manage Login Keys in DirectAdmin. Login Keys allow you to generate special access tokens that can log in to DirectAdmin automatically without using your main account password.
Overview
Login Keys are ideal for:
- Automated scripts
- External applications
- API integrations
- Temporary access tokens
- Password‑less logins with restricted permissions
Each Login Key can have:
- Its own permissions
- Its own expiry date
- IP restrictions
- Command restrictions
This makes Login Keys far safer than sharing your main password.
Requirements
- DirectAdmin user-level access
- A domain or account with API access enabled (default)
Step-by-Step Instructions
1. Access Login Keys
- Log in to DirectAdmin
- Go to Advanced Features → Login Keys
- Select the user account you want to manage
2. Create a New Login Key
- Click “Create Login Key”
- Enter a name for the key (example: deploy-script)
- Choose a password for the key (this is the token used by scripts)
- Set an expiry date (optional)
- Choose permissions:
• Full access
• API-only
• Specific commands only
- Save the key
3. Restrict Login Key Access (Recommended)
You can restrict the key by:
- IP address (example: only allow your server IP)
- Allowed commands (example: only allow file uploads)
- Expiration date (example: valid for 24 hours)
4. Using a Login Key
Login Keys can log in via:
- DirectAdmin web interface
- API calls
- Automated scripts
Example API login URL:
https://yourdomain.com:2222/CMD_API_SHOW_USER_CONFIG?login=USERNAME&passwd=LOGINKEYPASSWORD
5. Edit an Existing Login Key
- Go to Login Keys
- Click the key name
- Update permissions, IP restrictions, or expiry
- Save changes
6. Delete a Login Key
- Go to Login Keys
- Click “Delete” next to the key
- Confirm removal
This immediately revokes access.
Common Use Cases
Automated Deployments
Use a Login Key for scripts that upload files or trigger actions.
Third‑Party Integrations
Grant limited access to billing systems, monitoring tools, or automation bots.
Temporary Access
Create a short‑lived key for a developer or contractor.
Troubleshooting
Login Key Not Working
- Ensure the key is enabled
- Check IP restrictions
- Verify the correct username + key password are used
- Confirm the key has permission for the requested command
API Requests Failing
- Ensure the URL uses HTTPS
- Confirm the port is correct (default: 2222)
- Check for command restrictions
Key Expires Unexpectedly
- Verify the expiry date
- Remove or extend the expiration if needed
Security Notes
- Never share your main DirectAdmin password
- Use Login Keys for all automation tasks
- Restrict keys by IP whenever possible
- Delete unused keys immediately
Related Articles
- [SSH Keys](ca://s?q=SSH_Keys)
- [Two‑Step Authentication](ca://s?q=Two_Step_Authentication)
- [Password Protected Directories](ca://s?q=Password_Protected_Directories)
- [Web App Firewall](ca://s?q=Web_App_Firewall)
- [Backup & Restore](ca://s?q=Backup_and_Restore)