LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-04-2010, 02:29 AM   #1
barnrygravel
LQ Newbie
 
Registered: Jul 2010
Posts: 4

Rep: Reputation: 0
Unhappy Cannot get a response from server as I get a Unauthorised message


Have a Java program which simply connects to a server and gets back the response from the website.

When I use it under Windows environment it runs fine and i receive a Response Code: 200, , Response Message: OK
but in UNIX i get Response Code 401, Response Message Unauthorized

In Unix I tried to ping the website using the ping command.

ping <website>
<website> is alive

I use putty to connect to a Unix m/c.
I don't have any permissions to install any programs so could not install any s/w so i could check if i were able to reach the website.

Is it a Proxy Server related issue ?
If yes how do i configure it ?
 
Old 08-04-2010, 12:01 PM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
HI barnrygravel Wel-come to LQ,

sorry but i am confuse....

Quote:
Have a Java program which simply connects to a server and gets back the response from the website.

When I use it under Windows environment it runs fine and i receive a Response Code: 200, , Response Message: OK
but in UNIX i get Response Code 401, Response Message Unauthorized
ok.. How your program connect to server? It only check connectivity or connect to specific service like ftp,mysql, etc....

Quote:
I use putty to connect to a Unix m/c.
I don't have any permissions to install any programs so could not install any s/w so i could check if i were able to reach the website.
Do you require to install this program?

How you run your program?
 
Old 08-04-2010, 12:12 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
I honestly don't know what you are doing... but anyway... what's the permissions settings for ping?

do this and tell us the output:

Code:
ls -l $( which ping )
 
Old 08-05-2010, 02:12 AM   #4
barnrygravel
LQ Newbie
 
Registered: Jul 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Hi sem007,

Thanks for the warm welcome! Sorry did not post clearly.

Quote:
ok.. How your program connect to server? It only check connectivity or connect to specific service like ftp,mysql, etc....
Program is basically designed just to connect to the website's server or for that matter any m/c corresponding to a URL and get some acknowledgement from it so that we know that we are successfully able to communicate with the website . In order to determine the status a Response Code is collected from the server. Program uses HTTP & HTTPS protocols.

Ideally the Response code 200 is expected(http://www.w3.org/Protocols/HTTP/HTRESP.html)

This happens in case its run on windows but when the same program is run on Unix a Response code 401 (Unauthorized) is returned.



Quote:
Do you require to install this program?

How you run your program?
Putty (http://www.putty.org/) is a program which I have installed on the windows m/c in order to connect to the Unix m/c.

Can simply login to Unix using Putty after specifying the required credentials.

To compile & run the Java Program the usual commands javac and java are used.Had tried to use some Proxy settings (as I thought it might be because of it) too but was unable to do so.
 
Old 08-05-2010, 02:28 AM   #5
barnrygravel
LQ Newbie
 
Registered: Jul 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Hi eantoranz,

Thanks for the reply.

Quote:
do this and tell us the output:

Code:
ls -l $( which ping )
I believe I have Read & Execute permissions

Code:
snv891!abmittal:~/test [107]> ls -l $( which ping )
Illegal variable name.
snv891!abmittal:~/test [109]> which ping
/usr/sbin/ping
snv891!abmittal:~/test [110]> ls -l /usr/sbin/ping
-r-sr-xr-x   1 root     bin        47932 Sep 30  2004 /usr/sbin/ping
Let me know if this is what you wanted.
 
Old 08-05-2010, 02:36 AM   #6
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
That's not what I wanted.... I though you were using bash.

Can you get the ls -l for ping, wherever it is?
 
Old 08-05-2010, 02:36 AM   #7
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Nevermind... I just saw it.
 
Old 08-06-2010, 12:13 AM   #8
barnrygravel
LQ Newbie
 
Registered: Jul 2010
Posts: 4

Original Poster
Rep: Reputation: 0
So what could be the problem ?
 
Old 08-06-2010, 05:10 AM   #9
LVsFINEST
Member
 
Registered: Aug 2006
Posts: 99

Rep: Reputation: 21
If you're getting HTTP response codes back, ping is definitely not the utility being called, if any, so there's no problem there. And since you're actually getting a valid HTTP response back, I don't think the problem is with your java app either.

Does the URL you're checking require authentication? Or is there a "very defensive security policy" on the webserver? Those are about the only two reasons for getting a 401:

http://www.checkupdown.com/status/E401.html

So either you typo'ed the credentials on your linux java app, or there is some security feature on the web server denying the linux version.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
GTK message dialog, problem with default response simopal6 Programming 1 03-22-2012 04:26 AM
bind9 status - no response message deibertine Linux - Newbie 8 08-05-2010 02:02 PM
Tracing unauthorised (or incompetent) user activity Kevin Joubert Linux - Security 12 04-21-2010 05:42 PM
Assistance needed to investigate unauthorised download by unknown service nic2 Linux - General 2 11-18-2008 08:26 PM
unauthorised file erase pingvina Linux - Software 28 02-21-2006 01:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:56 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration