我正在尝试设置对 D-Bus 的远程访问,但我不明白身份验证和授权是如何(不)工作的。
我有一个 D-Bus 服务器侦听抽象套接字。
$ echo $DBUS_SESSION_BUS_ADDRESS
unix:abstract=/tmp/dbus-g5sxxvDlmz,guid=49bd93b893fe40d83604952155190c31
Run Code Online (Sandbox Code Playgroud)
我跑过dbus-monitor
去看发生了什么事。我的测试用例是notify-send hello
,它在从本地机器执行时有效。
从同一台机器上的另一个帐户,我无法连接到该总线。
otheraccount$ DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-g5sxxvDlmz,guid=49bd93b893fe40d83604952155190c31 dbus-monitor
Failed to open connection to session bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
otheraccount$ DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-g5sxxvDlmz,guid=49bd93b893fe40d83604952155190c31 notify-send hello
Run Code Online (Sandbox Code Playgroud)
浏览了D-Bus 规范后,我复制~/.dbus-keyrings/org_freedesktop_general
到另一个帐户,但没有帮助。
我尝试通过 TCP 转发 D-Bus 套接字,灵感来自schedar的Access D-Bus …
我在工作中使用 Fedora 笔记本电脑上的 rdesktop 连接到 Windows 计算机。为了方便起见,我在 .bashrc 中创建了一个别名:
alias companyremote='rdesktop -u USER -p - -g 1920x1040 -K'
Run Code Online (Sandbox Code Playgroud)
所以我只需要输入
companyremote NAME
Run Code Online (Sandbox Code Playgroud)
连接到给定的计算机。但我不想将密码以明文形式存储在 .bashrc 中,因此我必须每次都在标准输入中键入密码。我宁愿有一个干净的命令,没有其他所需的输入,只需要我成为某个用户。
我想 VPN 连接是主要的安全层,而不是实际的 Windows 密码,但我宁愿安全也不愿不安全,为什么不学点东西呢?
如何存储可以与这样的别名一起使用的加密密码?