小编Nur*_*ges的帖子

使用 Upstart 管理 AutoSSH 反向隧道

我正在使用 upstart 通过 autossh 管理反向 SSH 隧道。当我执行“sudo start tunnel”时,连接正常;但是,当网络服务启动时,该命令不会自动运行,无论我如何更改“启动”属性,我似乎都无法让它以自动方式运行。

但是,就像我说的,我可以很好地启动/停止它。

这是我的 /etc/init/tunnel.conf,去掉了敏感内容:

description "SSH Tunnel"

start on started networking
stop on stopping networking

respawn

env DISPLAY=:0.0

exec autossh -nNT -R 22100:localhost:22 myuser@myserver.com -p 2201
Run Code Online (Sandbox Code Playgroud)

linux ssh init upstart ubuntu-10.04

10
推荐指数
1
解决办法
4853
查看次数

如何在 lighttpd 中为除一个目录之外的所有目录启用 http auth?

我正在尝试验证对 webroot (/ ) 中所有内容的访问权限,除了驻留在特定目录 (/directory/ ) 中的任何内容,我尝试了这两个选项均无济于事:

$HTTP["url"] =~ "^(?!(/directory))" {
    auth.require = ( "" =>
            (
            "method" => "basic",
            "realm" => "auth to this area",
            "require" => "user=username"
            )
    )
}

$HTTP["url"] != "/directory" {
    auth.require = ( "" =>
            (
            "method" => "basic",
            "realm" => "auth to this area",
            "require" => "user=username"
            )
    )
}
Run Code Online (Sandbox Code Playgroud)

lighttpd http-basic-authentication

6
推荐指数
1
解决办法
2916
查看次数