修复root下面“rm -r ~”错误

修复root下面“rm -r ~”错误

我以 root 身份运行终端,安装包后发现我错误地创建了一个新目录。

rm -r当我的猫跳上我的桌子时,我开始输入目录。

rm -r ~在我到达它踏上我的键盘并按下回车键之前,我已经到达了那里。

现在我到目前为止……除了无法cd以 root 身份运行而没有任何路径指定外,似乎没有出现任何问题。所有其他用户仍可工作。我正在运行 Ubuntu 16.04 (Xubuntu)

我该如何修复根目录以及能找出被删除的内容吗rm

我痛苦地意识到我可能犯了很多错误,我请求你们原谅!!

编辑:

到目前为止,我遇到的唯一错误是以nautilusroot 身份运行,并在终端上打印以下内容:

(nautilus:26195): libunity-CRITICAL **: unity-launcher.vala:157: Unable to connect to session bus: The connection is closed

(nautilus:26195): libunity-CRITICAL **: unity-launcher.vala:157: Unable to connect to session bus: The connection is closed

(nautilus:26195): libunity-CRITICAL **: unity-launcher.vala:157: Unable to connect to session bus: The connection is closed
Error creating proxy: The connection is closed (g-io-error-quark, 18)
Error creating proxy: The connection is closed (g-io-error-quark, 18)
Error creating proxy: The connection is closed (g-io-error-quark, 18)
Error creating proxy: The connection is closed (g-io-error-quark, 18)
Error creating proxy: The connection is closed (g-io-error-quark, 18)

(nautilus:26195): dconf-WARNING **: failed to commit changes to dconf: The connection is closed

(nautilus:26195): dconf-WARNING **: failed to commit changes to dconf: The connection is closed

(nautilus:26195): GLib-GIO-CRITICAL **: g_dbus_connection_call_internal: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

答案1

如果你没有自定义环境变量或要在登录时运行的脚本,那么可能很简单mkdir /root

如果您确实有自定义脚本,则必须在执行此操作后重新创建它们。

如果您以 root 身份远程登录(非常不推荐),则需要重新创建~/.ssh文件夹并创建一个authorized_keys文件。不要忘记ssh在其中添加您登录的任何主机的密钥。

相关内容