Ubuntu: How to login to a website from another system through ssh [closed]



Question:

I'm new at this system.

In my University to access the internet, we need to login to the server using our LDAP id. As in the link:

enter image description here

We will automatically get signed out after a particular time. I set up a workstation in Linux(Ubuntu 14.04), due to some specific reasons it doesn't have access to monitor. So I'm using it through ssh.

Now my question is, how can I login from my laptop(macOS Sierra) using ssh. Means I want to go that page and need to give username and password so that I can download my python required packages and libraries.

Edit 1: Laptop and the Ubuntu workstation are in the same network. Edit 2: I know the ip address of my workstation. Edit 3: I want to install some python packages, but without login, I can't do that


Solution:1

The login form on that site probably does an HTTP POST request to login to the server. You can replicate that with wget on the Ubuntu system, for example:

username='myusername'  password='mypassword'  wget --no-proxy --quiet --post-data="user=$username&pass=$password&submit=submit" https://internet.foo.bar  

What you need to figure out, and we can't help with, is what the names of the form fields are (here I have used user, pass and submit). You'll have to inspect the source of the HTML page in Firefox or Chrome and see what the id values for the username and password fields are, and probably for the submit button too, and change the wget command's POST data accordingly.


Solution:2

You could use a Shell Webbrowser Like w3m to browse the page from within the Linux shell via ssh.

To install it run

 sudo apt install w3m  

on the Linux machine.

Then browse the web using

 w3m https://www.google.de  

or the page of your University. Than you should be able to provide your credentials and browse as in a Webbrowser.

To exit w3m press q and answer with y.

For a complete documentation look here


Solution:3

You can ssh from your laptop into the workstation using X forwarding and use the browser to log into your university account.

First, enable X forwarding in your /etc/ssh/sshd_config on the workstation by specifying X11Forwarding yes and then ssh -X you@workstation from your laptop and run the browser on the workstation from command line, the browser window should appear on your laptop screen.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »