Add Users to Virtualizor Panel: 2 Easy Steps – OrcaCore
This article delves into the user management aspects of Virtualizor, a powerful web hosting control panel. Specifically, we’ll explore the different user types available and how to add users, including administrators, to your Virtualizor panel. Understanding user roles and permissions is crucial for maintaining a secure and efficiently managed hosting environment. You can find more Virtualizor-related guides on the Virtualizor Tutorials page.
Virtualizor, like many control panels, provides a dedicated user management section. This allows for granular control over who has access to your system and what they can do. Let’s examine the available options within this section to Add Users to Virtualizor Panel. The following steps will guide you through the process.
Adding users to a Virtualizor (VPS Users)
First, log in to your Virtualizor panel by accessing serverIP:4085
in your web browser. Enter your credentials to access the panel. On the left-hand menu, navigate to the "Users" section and select the "Add user" sub-menu. This will display the user creation page, as illustrated below. As you can see, Virtualizor offers three primary user types: User, Cloud, and Admin.
<figure>
<img decoding="async" width="1024" height="576" src="https://bluehoster.info/wp-content/uploads/2023/08/1-3-1024x576.webp" alt="Add Users page in virtualizor first page" srcset="https://bluehoster.info/wp-content/uploads/2023/08/1-3-1024x576.webp 1024w, https://bluehoster.info/wp-content/uploads/2023/08/1-3-300x169.webp 300w, https://bluehoster.info/wp-content/uploads/2023/08/1-3-768x432.webp 768w, https://bluehoster.info/wp-content/uploads/2023/08/1-3-1536x864.webp 1536w, https://bluehoster.info/wp-content/uploads/2023/08/1-3-150x84.webp 150w, https://bluehoster.info/wp-content/uploads/2023/08/1-3-696x392.webp 696w, https://bluehoster.info/wp-content/uploads/2023/08/1-3-1068x601.webp 1068w, https://bluehoster.info/wp-content/uploads/2023/08/1-3.webp 1920w" sizes="(max-width: 1024px) 100vw, 1024px">
<figcaption>Add Users to Virtualizor Panel</figcaption>
</figure>
Items on the User Tab
Let’s break down the fields you’ll encounter on the "User" tab. These fields are essential for creating a standard VPS user account. To Add Users to Virtualizor Panel, understanding each field is crucial.
- User Email: The email address of the user. This is used for communication and password recovery.
- Password: The password for the new user account. Choose a strong, unique password.
- First Name: The user’s first name.
- Last Name: The user’s last name.
- DNS Plan: The DNS plan assigned to the user. This determines how the user’s domains are handled.
Once you’ve filled in these fields, click "Save User" to create the account.
How to add Cloud users to the Virtualizor panel? (Reseller Users)
This section enables you to create reseller accounts for your services and servers. You’ll find configuration options such as the number of VMs allowed, the number of users they can create, maximum disk space, and allowed virtualization types. This configuration allows you to impose limitations on your resellers, tailoring their access and resources to your specific business needs.
For detailed explanations of each field, click the "i" icon next to it. This will provide additional information about the field’s purpose and how it affects the reseller account.
<figure>
<img decoding="async" width="1024" height="600" src="https://bluehoster.info/wp-content/uploads/2023/08/Add-cloud-users-virtualizor-panel.webp" alt="Add cloud users to the virtualizor - info fields orcacore" srcset="https://bluehoster.info/wp-content/uploads/2023/08/Add-cloud-users-virtualizor-panel.webp 1024w, https://bluehoster.info/wp-content/uploads/2023/08/Add-cloud-users-virtualizor-panel-300x176.webp 300w, https://bluehoster.info/wp-content/uploads/2023/08/Add-cloud-users-virtualizor-panel-768x450.webp 768w, https://bluehoster.info/wp-content/uploads/2023/08/Add-cloud-users-virtualizor-panel-150x88.webp 150w, https://bluehoster.info/wp-content/uploads/2023/08/Add-cloud-users-virtualizor-panel-696x408.webp 696w" sizes="(max-width: 1024px) 100vw, 1024px">
</figure>
How to add Admin users to the Virtualizor panel? (Admin Users)
If you need to grant administrative access to other users for managing users and VPSs, this is the section to use. The process is similar to creating a standard "User," but with an added "Access Control" drop-down list.
This list allows you to select the access level for the new administrator. It’s important to note that you must define administrator access levels (Access Control Lists – ACLs) beforehand. These ACLs determine the specific permissions granted to the admin user.
Finally, click "Save user" to create the new administrator account. The process to Add Users to Virtualizor Panel is the same for all types, but the access levels are very different.
Conclusion
This tutorial covered how to Add Users to Virtualizor Panel and the different user types and access levels available. Understanding these options is crucial for effective server management and security. Thank you for reading!
You may be interested in other posts on our Virtualizor Tutorial tag:
- Migrate VPS Storage on Virtualizor
- Migrate VPS on Virtualizor between two servers
- Template in Virtualizor
- Failed to Start Error in Virtualizor
Alternative Solutions for User Management in Virtualizor
While the Virtualizor panel provides a user-friendly interface for adding and managing users, alternative approaches can offer increased flexibility and automation, especially in larger or more complex hosting environments. Here are two different ways to achieve similar results: using the Virtualizor API and integrating with a centralized Identity Provider (IdP).
1. Using the Virtualizor API
Virtualizor offers a comprehensive API (Application Programming Interface) that allows you to interact with the panel programmatically. This means you can automate user creation, modification, and deletion using scripts or custom applications. This is particularly useful for integrating Virtualizor with other systems, such as billing platforms or customer management systems.
Explanation:
The Virtualizor API allows you to perform virtually any action you can perform through the web interface. By using the API, you can streamline user management by automating tasks that would otherwise require manual intervention. This reduces the risk of human error and saves time, especially when dealing with a large number of users.
Code Example (PHP):
This example demonstrates how to add a user using the Virtualizor API with PHP. You’ll need to adjust the API credentials (API Key and API Password) to match your Virtualizor installation.
<?php
// Virtualizor API Details
$api_url = 'https://your_virtualizor_server:4085/index.php?act=api'; // Replace with your Virtualizor server URL
$api_key = 'YOUR_API_KEY'; // Replace with your API Key
$api_password = 'YOUR_API_PASSWORD'; // Replace with your API Password
// User Details
$user_email = 'newuser@example.com';
$password = 'StrongPassword123';
$firstname = 'John';
$lastname = 'Doe';
$dnsplan = 'default'; // Ensure this DNS plan exists
// API Parameters
$params = array(
'api' => '1',
'apikey' => $api_key,
'apipass' => $api_password,
'action' => 'add_user',
'email' => $user_email,
'password' => $password,
'fname' => $firstname,
'lname' => $lastname,
'dnsplan' => $dnsplan,
'type' => 'user' // User, cloud, or admin
);
// Build the query string
$query_string = http_build_query($params);
// Construct the full API URL
$full_api_url = $api_url . '&' . $query_string;
// Make the API request
$response = file_get_contents($full_api_url);
// Decode the JSON response
$result = json_decode($response, true);
// Check for errors
if (isset($result['error'])) {
echo 'Error: ' . $result['error'];
} else {
echo 'User added successfully!';
print_r($result); // Optionally, print the full response for debugging
}
?>
Explanation of the code:
- API Details: Replace placeholders with your Virtualizor server URL, API key, and API password.
- User Details: Define the details for the new user you want to create.
- API Parameters: Construct an array containing all the necessary parameters for the
add_user
action. Thetype
parameter specifies the type of user to create (user, cloud, or admin). - Build Query String: Use
http_build_query
to create a URL-encoded query string from the parameters. - Construct Full API URL: Combine the base API URL with the query string.
- Make API Request: Use
file_get_contents
to make a GET request to the API endpoint. - Decode JSON Response: Decode the JSON response from the API into a PHP array.
- Check for Errors: Check if the response contains an error message. If so, display the error.
- Success Message: If the user was added successfully, display a success message. You can optionally print the full response for debugging purposes.
Important Considerations:
- Security: Store your API key and password securely. Avoid hardcoding them directly into your scripts. Consider using environment variables or a secure configuration file.
- Error Handling: Implement robust error handling to gracefully handle API errors and prevent unexpected script behavior.
- Rate Limiting: Be mindful of API rate limits. Avoid making excessive requests in a short period.
- Documentation: Refer to the Virtualizor API documentation for a complete list of available actions and parameters.
2. Integrating with a Centralized Identity Provider (IdP)
For organizations with existing identity management systems, integrating Virtualizor with a centralized Identity Provider (IdP) such as Okta, Keycloak, or Azure AD can simplify user management and improve security.
Explanation:
Instead of managing users directly within Virtualizor, you can delegate authentication and authorization to the IdP. When a user attempts to log in to Virtualizor, they are redirected to the IdP for authentication. Once authenticated, the IdP provides Virtualizor with the user’s identity and any associated roles or permissions. This allows you to manage user accounts and access control in a single, centralized location.
Benefits of IdP Integration:
- Single Sign-On (SSO): Users can log in to Virtualizor using their existing credentials, eliminating the need to remember separate usernames and passwords.
- Centralized Management: Manage user accounts, permissions, and security policies in one place.
- Improved Security: Enforce strong authentication methods, such as multi-factor authentication (MFA), through the IdP.
- Simplified Onboarding/Offboarding: When a user joins or leaves the organization, their access to all integrated applications, including Virtualizor, can be easily managed through the IdP.
Implementation:
The specific steps for integrating Virtualizor with an IdP will depend on the chosen IdP and the authentication protocols supported by Virtualizor (e.g., SAML, OAuth). You will typically need to configure Virtualizor as a relying party or client application within the IdP and configure the IdP details within Virtualizor.
Code Example (Conceptual):
While a direct code example for IdP integration within Virtualizor is not readily available without specific details of the IdP and Virtualizor’s integration capabilities, here’s a conceptual outline of the process using SAML (Security Assertion Markup Language):
-
Virtualizor (Service Provider – SP) Configuration: Configure Virtualizor with the IdP’s metadata URL or XML file. This contains information about the IdP’s signing certificate and endpoints.
-
IdP (Identity Provider) Configuration: Register Virtualizor as a Service Provider (SP) within the IdP. Provide the IdP with Virtualizor’s Assertion Consumer Service (ACS) URL (the URL where the SAML assertion will be sent).
-
SAML Assertion Handling (within Virtualizor – likely handled by Virtualizor’s internal code): When a user tries to log in:
- Virtualizor redirects the user to the IdP’s login page.
- The user authenticates with the IdP.
- The IdP sends a SAML assertion (an XML document containing user information and authentication status) to Virtualizor’s ACS URL.
- Virtualizor validates the SAML assertion (checks the signature, issuer, and other parameters).
- Virtualizor extracts user information from the SAML assertion and logs the user in.
# Conceptual Python example (Illustrative - requires SAML library and Virtualizor-specific implementation)
# This is a simplified example and does NOT represent complete, working code for Virtualizor
# In reality, Virtualizor likely has built-in SAML handling
# You would need to consult Virtualizor's documentation for their specific SAML integration.
# This example just shows the conceptual steps of SAML assertion validation
# pip install python3-saml (example library - may not be directly compatible)
from saml2 import SPConfig
from saml2.client import Saml2Client
# Load Virtualizor's SAML configuration (SP config)
sp_config = SPConfig()
sp_config.load_xml_string("""
<sp_config>
<metadata>
<remote>
<url>https://your_idp_server/metadata</url> # Replace with your IdP metadata URL
</remote>
</metadata>
<service>
<sp>
<endpoints>
<assertion_consumer_service>
<binding>urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST</binding>
<url>https://your_virtualizor_server/saml/acs</url> # Replace with your Virtualizor ACS URL
</assertion_consumer_service>
</endpoints>
</sp>
</service>
</sp_config>
""")
# Create a SAML2 client
saml_client = Saml2Client(config=sp_config)
# Assume you received a SAML assertion from the IdP (in a POST request)
# This part is HIGHLY simplified and requires much more robust error handling and security checks
assertion = request.POST.get('SAMLResponse') # Get the SAML assertion from the POST data
if assertion:
try:
authn_response = saml_client.parse_authn_request_response(
assertion, entity_id="your_idp_entity_id", # Replace with your IdP entity ID
binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
)
if authn_response.is_valid():
user_id = authn_response.get_identity() # Extract the user's ID
# ... (Look up user in Virtualizor, create session, etc.)
print(f"User authenticated successfully: {user_id}")
else:
print("SAML assertion is invalid")
except Exception as e:
print(f"Error processing SAML assertion: {e}")
else:
print("No SAML assertion received")
Important Notes:
- This code is highly conceptual. It illustrates the basic principles of SAML assertion validation.
- You’ll need a SAML library for your programming language (e.g.,
python3-saml
for Python). - Virtualizor likely handles much of the SAML processing internally. Consult Virtualizor’s documentation for their specific SAML integration instructions.
- Security is paramount. Ensure you properly validate the SAML assertion and protect against potential attacks.
These alternative solutions offer more advanced ways to manage users in Virtualizor, providing greater flexibility and integration capabilities. The choice of which method to use depends on your specific needs and the complexity of your environment. The process to Add Users to Virtualizor Panel can be simplified with API. Remember to always prioritize security and consult the official Virtualizor documentation for detailed instructions and best practices.