ssh-add -l
向您显示已添加的所有 ssh 密钥ssh-add ~/.ssh/id_yourkey
。我如何用 gpg 和 gpg-agent 做类似的事情,换句话说,让它显示缓存键的列表?
我有两台带有两个串行端口的计算机:ttyS0 和 ttyUSB0。(实际上它们在同一台计算机上,但这仅用于测试)。这些端口通过零调制解调器电缆连接。我希望能够简单地将字节发送到一端并从另一端出来,反之亦然。为什么以下不起作用?:
# set both serial ports to 9600 8n1
# `-parenb` means no parity,
# `-cstopb` means 1 stop bit
# cs8 means 8 bits at a time
stty -F /dev/ttyUSB0 cs8 -cstopb -parenb 9600
stty -F /dev/ttyS0 cs8 -cstopb -parenb 9600
# in one terminal:
echo "asdf" > /dev/ttyUSB0
# in another terminal, this hangs and does nothing
cat < /dev/ttyS0
Run Code Online (Sandbox Code Playgroud)
我可以netcat
很容易地使用和管道做类似的事情(如下),所以我觉得上面的事情也应该是可能的。
mkfifo mypipe
# in one terminal
cat < mypipe
# in another. works …
Run Code Online (Sandbox Code Playgroud) 我熟悉创建普通的 systemd 服务。然而,在学习如何配置wireguard时,我在服务名称中遇到了“@”符号,并且想知道它到底是如何工作的。
例如,在wireguard中,您可以配置一个连接,/etc/wireguard/wg0.conf
然后通过运行来控制该连接,就像它拥有自己的服务文件一样sudo systemctl [enable|disable|start|stop|whatever] wg-quick@wg0.service
。如果您创建第二个名为 的配置文件wg1.conf
,您可以通过wg-quick@wg1.service
.
这一切都非常方便,但是它是如何工作的呢?这叫什么?