FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
940 views 1 comments
by anonymous

I am trying to read an external site (list.cgi) which works well from the device itself and from other devices however when I try to read the site using the curl commando, I keep getting that my credetials are not correct or not being sent correct.

Any clue how I can get around this?

the command is: curl -s "http://<username:password>@<IP-address>/list.cgi"

I use RUT230 with FW RUT2XX_R_00.01.11.3

3 Answers

0 votes
by anonymous

Hello,

What do you mean by: "works well from the device itself and from other devices"? Same curl command works from router, but does not work from devices behind said router, or other unrelated devices? 

And could you post exact errors that you are getting?

Best regards,
VidasKac.

0 votes
by anonymous

Maybe if I tell more about the project:

I have a device A that I only can retrieve infromation from, a CGI script.

I want the router to call the script then forward this infromation to our webserver.

The reason I want to do this on the router is because I can not change anything on devices A.

The problem is that I am unable to get the information from the device using the router, I keep getting the error:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
</body></html>

I tried setting up SSH keys and the devices do not ask for password sending the command:

curl -u root: --key /etc/dropbear/dropbear_rsa_host_key  http://10.10.100.
13/list.cgi

but still getting the same error.

by anonymous

Hello,

Have you tried using different syntax for use/password in your curl command? e.g. curl -u <user:pasword> <host address>/list.cgi ?

0 votes
by anonymous
I tried as suggested curl -u <user:password> <link>/list.cgi but I still get that server could not verify that I am authorized.