squid代理ubuntu的基本身份验证

时间:2015-06-03 13:57:58

标签: basic-authentication squid

我已经使用凭据为Ubuntu设置了基本身份验证的squid代理,并使用浏览器进行了用户名和密码测试。

现在我想通过命令行连接它。使用MacOs命令行并尝试连接到远程终端设置到ssh端口

CONNECT 192.111.222.33:22 HTTP/1.0 Proxy-Authorization: Basic <usernamepasswordencodedinbase64format> and press enter twice 

收到此错误

HTTP / 1.0 400错误请求 服务器:squid / 3.1.19 哑剧版:1.0 日期:2015年6月3日星期三13:38:35 GMT 内容类型:text / html 内容长度:3740 X-Squid-Error:ERR_INVALID_REQ 0 变化:接受语言 内容 - 语言:en X-Cache:来自localhost的MISS X-Cache-Lookup:来自localhost的无:3128 通过:1.0 localhost(squid / 3.1.19)

Connection: close

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: The requested URL could not be retrieved</title>

<ul>
<li id="missing-method"><p>Missing or unknown request method.</p></li>
<li id="missing-url"><p>Missing URL.</p></li>
<li id="missing-protocol"><p>Missing HTTP Identifier (HTTP/1.0).</p></li>
<li><p>Request is too large.</p></li>
<li><p>Content-Length missing for POST or PUT requests.</p></li>
<li><p>Illegal character in hostname; underscores are not allowed.</p></li>
<li><p>HTTP/1.1 <q>Expect:</q> feature is being asked from an HTTP/1.0 software.</p></li>
</ul>

请帮助

1 个答案:

答案 0 :(得分:0)

我只需要按回车键并键入此代理授权:基本而不是由于信息不良而导致错误的同一行。所以就像

CONNECT 192.111.222.33:22 HTTP/1.0  press enter 
Proxy-Authorization: Basic <usernamepasswordencodedinbase64format> and press enter