在我正在初始化的 VM 上,我能够以一个非 root 用户 ( admin) 的身份登录,但不能以另一个 ( tbbscraper) 身份通过 SSH 使用公钥身份验证登录。我可以在任何日志文件中找到的唯一错误消息是
Sep 18 17:21:04 [REDACTED] sshd[18942]: fatal: Access denied for user tbbscraper by PAM account configuration [preauth]
Run Code Online (Sandbox Code Playgroud)
在客户端,该综合症是
$ ssh -v -i [REDACTED] tbbscraper@[REDACTED]
...
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: [REDACTED]
debug1: Authentications that can continue: publickey
debug1: Trying private key: [REDACTED]
debug1: read PEM private key done: type RSA
Connection closed by …Run Code Online (Sandbox Code Playgroud) 几个不同的地方(例如http://wiki.wireshark.org/CaptureSetup/NFLOG)推荐使用 Linux 的“NFLOG”防火墙模块来捕获特定 UID 生成的数据包,如下所示:
# iptables -A OUTPUT -m owner --uid-owner 1000 -j CONNMARK --set-mark 1
# iptables -A INPUT -m connmark --mark 1 -j NFLOG --nflog-group 30
# iptables -A OUTPUT -m connmark --mark 1 -j NFLOG --nflog-group 30
# dumpcap -i nflog:30 -w uid-1000.pcap
Run Code Online (Sandbox Code Playgroud)
我一直无法找到任何关于它是如何工作的文档(特别是,netfilter.org有很多写得很糟糕的库 API 文档,据我所知,在实际内核级防火墙的语义上没有任何内容规则),所以我有几个问题:
是否有任何该死的文档,它藏在哪里?
CONNMARK的东西真的有必要吗?也就是说,这也能正常工作吗?
# iptables -A INPUT -m owner --uid-owner 1000 -j NFLOG --nflog-group 30
# iptables -A OUTPUT -m owner --uid-owner 1000 -j NFLOG --nflog-group …Run Code Online (Sandbox Code Playgroud)