Accessing a URL on SSH without using a web browser

1

2

I would like to find a way to open a URL without using a web browser (which makes my computer system run very slow).

Is there an easy way to achieve this on a command prompt using SSH to access another network?

stanigator

Posted 2010-05-09T23:56:28.820

Reputation: 1 319

I remember reading an essay once where Richard Stallman (the founder of the FSF and the creater of GNU) described how he accesed websites when he was forced to use computers without a free software browser. He would wget the html of the website and just read the source. – crasic – 2011-08-11T05:20:21.290

Answers

2

ok...try this

from your local computer create an ssh connection forwarding local port 8080 to their web server

ssh  -L 8080:destcomputer.domain.com:80 destcomputer.domain.com

then you can run any browser you like on you local computer and connect to

localhost:8080

this should connect you to the webserver destcomputer.domain.com

bryan

Posted 2010-05-09T23:56:28.820

Reputation: 7 848

It looks promising. I tried to follow the direction here: http://help.ece.ubc.ca/How_To_Tunnel_Connections_Through_SSH

But it's still not very clear as I am having trouble tunneling the connection to my localhost. Any comments?

– stanigator – 2010-05-10T00:45:58.377

Nvm; set up a SOCKS proxy and solved my problems. – stanigator – 2010-05-10T00:56:34.897

glad it worked! – bryan – 2010-05-10T01:26:43.597

2

You can always use elinks in your SSH session. It's a great in-session SSH browser.

If you're just looking to download files, you can just wget them (wget http://test.com/file.html).

EDIT

Let's say you need to download http://test.com/file.pdf, but you require some sort of login first (as it sounded in your comment):

You'd login through SSH:

$ localmachine ~> ssh user@machine
user@machine's password: <password>
$ remotemachine ~> (elinks/links/lynx) http://test.com/login

You'd navigate around the site and log in, and when you select the URL of the file you want to download, links/elinks should ask you where you want to save the file. You can save that file to the machine you're SSH'd into, and scp it to your machine. If you need any more information, let me know :)

METHOD 2

If you have direct access to the file (say http://test.com/file.pdf) you can just run curl -O http://test.com/file.pdf or wget http://test.com/file.pdf and it will be saved to the current directory (every single machine I've ever SSH'd into has either wget or curl).

squircle

Posted 2010-05-09T23:56:28.820

Reputation: 6 365

What if it's a pdf that is only available to certain subscribers, which is the network that I'm accessing through ssh? – stanigator – 2010-05-10T00:09:01.490

@stanigator: Answer updated to reflect your comment. – squircle – 2010-05-10T00:19:10.357

Hmm...the machine that I'm accessing doesn't have links or elinks. I guess I may not be able to achieve my purpose this way. – stanigator – 2010-05-10T00:23:49.817

@stanigator: to get the file you're looking for, do you have to log in, or do you have direct access to it? – squircle – 2010-05-10T00:26:32.897

@stanigator: Does it have lynx? It's very common. See my answer. – Paused until further notice. – 2010-05-10T00:26:43.037

@thepurplepixel: I have direct access to it on the account that I'm logging in through ssh. – stanigator – 2010-05-10T00:29:54.467

@Dennis: according to a comment on bryan's question, it doesn't have lynx either. – squircle – 2010-05-10T00:29:58.600

@stanigator: see my edit; if you have direct access to it and know the URL, method 2 should work. – squircle – 2010-05-10T00:33:09.780

method 2 didn't really work either; I'll ask the network administrator to see if there are options where I can get the files my way. Thanks! – stanigator – 2010-05-10T00:43:07.033

1

Other text-mode browsers include Lynx, Links and Links 2 (with graphics with or without the X Window System, but not over ssh).

Paused until further notice.

Posted 2010-05-09T23:56:28.820

Reputation: 86 075

0

try

lynx 

its an older browser

bryan

Posted 2010-05-09T23:56:28.820

Reputation: 7 848

Nope. It doesn't have it. – stanigator – 2010-05-10T00:29:20.253

Not older, just better :D – crasic – 2011-08-11T05:18:24.070