在 /etc 中大量权限崩溃后,Ubuntu 拒绝所有连接

发布于 2024-11-14 21:14:34 字数 620 浏览 6 评论 0原文

今天早上,在尝试将一些文件从我的测试服务器迁移到我的实时服务器时;我犯了一个可怕的错误。

我试图从沙箱中提取我的 /etc/apache2 并将其投入使用,因此我暂时将 /etc/apache2 中的权限更改为 777 ,当我迁移时。

然而,我分心了,将 /etc 中的权限更改为 777。不管怎样,我花了四个小时解决了这个问题,而且或多或少都有效。

我设法让 sudoers 回到 0440,其他一切都在 755,这或多或少是中性的。

但现在,Ubuntu 立即拒绝来自每台计算机的每一种远程连接(Apache、MySQL、PhpMyAdmin 除外)。当我尝试从 Putty、Tunnelier 或 WINSCP 建立远程连接时,它立即拒绝连接,并显示一些错误消息,例如“网络错误”。

不管怎样,我真的不想听到我犯了这个错误是多么愚蠢,相信我;整个早上我都在恨自己。但如果有人对我如何解决这个问题有一些建议,我几乎可以肯定这是由于权限造成的。

This morning, while trying to migrate some files from my test server to my live server; I made a horrible mistake.

I was trying to pull my /etc/apache2 from the sandbox, and put it live, so I was temporarily changing the permissions in /etc/apache2 to 777, while I was migrating.

However, I had a massive distraction and changed the permissions in /etc to 777. Anyhow, I spent the last four hours fixing this problem, and it all more or less works.

I managed to get sudoers back to 0440, and everything else is at 755, which is more or less neutral.

But now, Ubuntu is instantly refusing every single kind of remote connection from every computer (except Apache, MySQL, PhpMyAdmin). When I try to make a remote connection from Putty, Tunnelier or WINSCP it just instantly refuses it with some error message like "Network Error".

Anyhow, I really don't want to hear how stupid I am for making this mistake, trust me; I have been hating myself all morning. But if anybody has some suggestions on how I can fix this problem, I almost certain that it is due to permissions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黎夕旧梦 2024-11-21 21:14:34

我非常确定您至少需要 chown rootchmod go-rwx openssh 私钥;仅对公钥进行读取访问;

其他密钥可能有相同的要求,但我假设 ssh 是您访问该服务器的第一个入口点。 ssh (sshd_config) 的手册页将包含确切的详细信息

I'm pretty sure that you are required to at least chown root and chmod go-rwx the openssh private key; Read access only on the public key;

Same requirements may go for other keys but I'm assuming ssh is your first point of entry for this server. The man page for ssh (sshd_config) will have the exact details

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文