In many institutions and workplaces, internet access is restricted using a web-based login portal like Cyberoam or Sophos. This typically requires users to authenticate via a browser using their username and password.
But what if you're working on a headless Linux system, like a server or Proxmox host, that has no GUI? Here's how you can log in to such networks directly from the terminal using curl.
Login via Terminal
To log in, run the following command in your terminal:
curl "http://192.168.0.1:8090/httpclient.html" \
-d "mode=191&username=mahesh&password=Pmahesh@sh&a=$(date +%s)&producttype=0"
If it has no curl installed use this
wget --post-data="mode=191&username=mahesh&password=Pmahesh@sh&a=$(date +%s)&producttype=0" "http://192.168.0.1:8090/httpclient.html" -O -
- Replace mahesh and Pmahesh@sh with your actual username and password.
- $(date +%s) adds a timestamp to avoid caching issues during login.
Logout via Terminal
To log out of the network, use:
curl "http://192.168.0.1:8090/logout.xml"
This cleanly ends your session on the network.
NB: The address http://192.168.0.1:8090 is the default login URL used, replace with yours