LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2011, 04:38 AM   #1
hshah
LQ Newbie
 
Registered: Nov 2011
Posts: 1

Rep: Reputation: Disabled
How to Telnet to different web servers using Linux (Ubunto)


I want to Telnet to a web server from my Linux operating system (Ubunto) e.g. "google.com" and retrieve the index page. Then may be Send a search query via Telnet and see what do i get. I am not sure which add-on i require and what procedure to follow. i am using Ubunto
 
Old 11-27-2011, 06:28 AM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by hshah View Post
I want to Telnet to a web server from my Linux operating system (Ubunto) e.g. "google.com" and retrieve the index page. Then may be Send a search query via Telnet and see what do i get. I am not sure which add-on i require
none at all, in theory. You just have to "speak" HTTP. For example, try "telnet www.google.com 80", then you're connected to one of Google's web servers. Now talk:
Code:
GET /search?q=tuna+sandwich HTTP/1.0    <enter>
Host: www.google.com   <enter><enter>
After the double enter, the server should reply with a bunch of HTTP header lines, the first of which would be:
Code:
HTTP/1.x 200 OK
After the first blank line, the actual response data starts, which should be an HTML document here.

As I said: In theory.
In practise, Google is a bad example, because they require some more HTTP header lines in the request - AFAIK the most important one is a User-Agent that looks like a real browser. But you may try that with some other plain vanilla HTTP server. That's just the way HTTP works.

Quote:
Originally Posted by hshah View Post
i am using Ubunto
Please note: That popular distribution is called Ubuntu (with a 'u' at the end).

[X] Doc CPU
 
1 members found this post helpful.
Old 11-27-2011, 06:32 AM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Why not use a text web browser like lynx?

Kind regards
 
Old 11-27-2011, 08:09 AM   #4
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by repo View Post
Why not use a text web browser like lynx?Kind regards
there had to be that answer sooner or later! ;-)

If it makes sense depends on what hshah really wants. If he's into lightweight, quick retrieval of online information without being annoyed by all the bells and whistles like ads and pseudo-friendly gimmicks, your suggestion is probably a good one. However, in that case he could just as well take a popular and widespread browser like Firefox or Opera and disable Javascript, CSS and display of images.

I thought that the OP might rather be interested in what browser and server are talking behind the scenes, and that would remain hidden with Lynx as well - or can you build arbitrary requests and view all HTTP response headers with Lynx? Probably not.

[X] Doc CPU
 
Old 11-27-2011, 12:20 PM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
It's never obvious whether questions like this are demonstrating some undeveloped enlightenment, or full naivete. I like to take the optimistic approach, and assume there is some well-reasoned basis for the question. On that basis, I will suggest creating an HTTP client in a scripting language, such as Perl. This is easily done with the example code in the lib-www-perl module on CPAN. Even if the OP doesn't elect to write anything in Perl, there is enough information about the underlying mechanisms there to contribute to a successful venture using telnet.
--- rod.
 
Old 11-27-2011, 04:38 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,001

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
http://www.dgate.org/~brg/bvtelnet80/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Troubleshooting Linux Servers with telnet LXer Syndicated Linux News 0 02-14-2011 11:51 PM
How to setup Linux web servers? stay92 Linux - Server 15 04-26-2009 04:30 PM
installed ubunto twice by mistake now in boot up screen get 2 options for ubunto salpapa Linux - Newbie 8 06-28-2007 05:24 PM
linux web servers trscookie Linux - General 2 12-26-2006 03:07 PM
cannot telnet from linux server to remote servers narenpg Linux - Networking 8 03-07-2005 04:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration