在过去的 2 个小时里,我一直在寻找解决以下问题的方法,但没有成功。
发展:
我正在使用公钥身份验证连接到我的服务器。我使用 ssh-agent 转发,以便不必管理公钥/私钥。
假设我有服务器A, B and C
。
如果我从LOCAL ---> A ---> B
.
如果我这样做,它也能很好地工作LOCAL ---> A ---> C
。
现在,如果我尝试LOCAL ---> A ---> B ---> C
,SSH 无法从B to C
.
值得注意的是:我作为流动性连接到服务器 A,而我作为 root 连接到服务器 B。作为流动性连接到服务器 B 解决了这个问题,但这对我来说不是一个选择。
根据用户的建议,我ssh -A
每次都使用以确保启用代理转发。
我发现了一个类似的问题,这里没有答案:Is it possible to chain ssh-agent forwarding through multiple hops?
根据这里的@Zoredache:https ://serverfault.com/a/561576/45671我只需要在每个中间系统上调整我的客户端配置。我相信我做到了。
这几天我一直在为这个问题苦苦挣扎:
foo[sha1oftheurl]=[randomvalue]
基本上,当且仅当 cookie 尚未设置时,我想向客户端浏览器发送以下形式的 cookie 。
例如,如果客户端浏览器请求“/page.html”,则 HTTP 响应将如下所示:
resp.http.Set-Cookie = "foo4c9ae249e9e061dd6e30893e03dc10a58cc40ee6=ABCD;"
那么,如果同一个客户端请求“/index.html”,HTTP响应将包含一个标头:
resp.http.Set-Cookie = "foo14fe4559026d4c5b5eb530ee70300c52d99e70d7=QWERTY;"
最终,客户端浏览器将会有2个cookie:
foo4c9ae249e9e061dd6e30893e03dc10a58cc40ee6=ABCD
foo14fe4559026d4c5b5eb530ee70300c52d99e70d7=QWERTY
现在,这本身并不复杂。下面的代码可以做到这一点:
import digest;
import random; ##This vmod does not exist, it's just for the example.
sub vcl_recv()
{
## We compute the sha1 of the requested URL and store it in req.http.Url-Sha1
set req.http.Url-Sha1 = digest.hash_sha1(req.url);
set req.http.random-value = random.get_rand();
}
sub vcl_deliver()
{
## We create a cookie on the client browser by creating a "Set-Cookie" header
## In …
Run Code Online (Sandbox Code Playgroud)