Contact Us
If you still have questions or prefer to get help directly from an agent, please submit a request.
Popular topics: Multilogin X, Multilogin 6,
-
Retrieving the token Using the automation token in a workspace Retrieving profile, folder, and workspace IDs Retrieving the user ID Selenium automation example Playwright automation example Puppeteer automation example Logging in to Multilogin automatically Setting up automatic cookie collection Auto-launching the agent Exporting proxy details from profiles Converting external proxy lists into API-ready JSON files Automation FAQHow to fix agent connection issues How to fix startup issues in Multilogin Account banned: what should I do? How to fix profile launch or proxy connection issues How to fix Mimic launch issues on Linux How to enable web camera in Multilogin profiles My app or profile is slow: how to fix performance issues How to unlock a locked profile How to find missing profiles How to fix website loading issues in Multilogin How to access restricted websites How to fix connection issues in restricted regions How to fix Stealthfox issues on Windows How to fix small Stealthfox window resolution on Windows How to fix Multilogin issues on macOS How to disconnect and reconnect the agent How to reinstall app components How to send logs to support How to fix "Failed to get profile data" error How to fix "Access denied" error How to fix “Some settings were reset” error How to fix “Plan limit reached” error How to fix “Wrong proxy data” error How to fix “ERR_CONNECTION_RESET” error
-
Common errors and solutions in Multilogin 6 How to fix profile launch issues in Multilogin 6 How to fix proxy connection issues in Multilogin 6 How to fix frozen "Update in progress... Loading [3] of 2 components" status How to fix Android profile issues in Multilogin 6 How to fix issues with extension data in Mimic How to fix Stealthfox issues on Windows How to fix "JavaScript error" in Multilogin 6 dark mode How to fix "Javax.crypto […] pad block corrupted" error How to fix "Fingerprint composition failed" error How to fix "Mimic/Stealthfox executable is not found" error How to fix "Downloading Mimic browser" error How to fix "Invalid buffer arguments" error How to fix "Cannot invite existing user" error
Logging in to Multilogin automatically
Written by Lierence Lim
Updated on July 27th, 2024
Table of contents
Connecting to Multilogin from multiple devices or servers manually can be time-consuming. To automate this process, you can use the Paramiko library in Python.
In this article, you will learn how to do this using our script example. It iterates through a list of servers, each with its own credentials, and executes connection commands.
Before you start
- Ensure your devices or servers are accessible via SSH with password authentication
- Install Python and libraries below on each device or server:
- requests
- paramiko
- Save the script
auto.py
on your local device - Save the script
signinmlx.py
on additional devices or servers - Insert your values into the below variables in the script
signinmlx.py
:-
USERNAME
: your Multilogin X account email -
PASSWORD
: your Multilogin X account password (MD5 encryption is not required)
-
- Insert your values into the below variables in the script
auto.py
:SERVER-USERNAME
SERVER-PASSWORD
SERVER-IP
Running the script
The script examples below contain basic setup that allows you to log in to your Multilogin X account on several servers. Additionally, you can:
- Add profile actions you want to trigger after sign in using
signinmlx.py
- Add more commands you want to execute on remote servers using
auto.py
- Add more servers to the parameter “users_credentials_and_ips” using
auto.py
signinmlx.py
import requests
from hashlib import md5
# Input your Multilogin X account credentials
USERNAME = ""
PASSWORD = ""
MLX_BASE = "https://api.multilogin.com"
MLX_LAUNCHER = "https://launcher.mlx.yt:45001/api/v1"
HEADERS = {"Accept": "application/json", "Content-Type": "application/json"}
# Function
def sign_in(username, password):
# HTTP requests to APIs
sign_url = "https://api.multilogin.com/user/signin"
HEADERS = {
"Accept": "application/json",
"Content-Type": "application/json",
}
Payload = {
"email": username,
"password": str(md5(password.encode()).hexdigest()),
}
# POST request
resp = requests.post(sign_url, json=Payload, headers=HEADERS)
resp_json = resp.json()
# got bearer token
token = resp_json["data"]["token"]
return token
# PART 1
token = sign_in(USERNAME, PASSWORD)
HEADERS["Authorization"] = "Bearer " + token
print("token: " + token, end="")
auto.py
import paramiko
# Define the commands to run
commands = [
# "mlx &",
"python3 signinmlx.py"
]
# Define the list of users, passwords, and their corresponding IPs
users_credentials_and_ips = [
# ("SERVER-USERNAME", "SERVER-PASSWORD", "SERVER-IP"),
("SERVER-USERNAME", "SERVER-PASSWORD", "SERVER-IP"),
]
# Iterate over each user, password, and IP
for user, password, ip in users_credentials_and_ips:
print(f"Connecting to {user}@{ip}")
try:
# Connect to the SSH server with password authentication
ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_client.connect(hostname=ip, username=user, password=password)
# Execute each command
for cmd in commands:
print(f"Running command: {cmd}")
stdin, stdout, stderr = ssh_client.exec_command(cmd)
output = stdout.read().decode("utf-8")
error = stderr.read().decode("utf-8")
if output:
print(output)
if error:
print(error)
# Close the SSH connection
ssh_client.close()
except Exception as e:
print(f"Error connecting to {user}@{ip}: {str(e)}")
Video guide
In this guide, we show how to run the auto.py
and signinmlx.py
scripts on a local machine with Windows 10 and a VirtualBox server with Ubuntu 20.