如果我将主目录的权限更改为777,该怎么办,而我的Google Cloud Server不再让我访问

发布于 2025-01-25 16:18:56 字数 131 浏览 2 评论 0 原文

在此处输入图像说明

更改了权限后,我不会越过此错误

enter image description here

After changing the permissions, I don't get past this error

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

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

发布评论

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

评论(1

一口甜 2025-02-01 16:18:56

您很可能更改了目录 .ssh 的许可。这打破了SSH安全性。您应该能够创建一个启动脚本来更改目录/home/&&>/。ssh 到700。

  • 转到 Google Cloud Console

  • 转到计算引擎 - > VM实例

  • 停止VM实例

  • 单击“编辑”按钮

  • 向下滚动到自定义元数据

  • 键输入 startup-script

  • 用用户名输入以下内容以替换< username> 使用您的用户名:

    #! /bin/bash

    chmod 700/home/< username>/。ssh

  • 重新启动实例

另一种方法是使用VM串行控制台:

Most likely you changed the permission of the directory .ssh. This breaks SSH security. You should be able to create a startup script to change the directory /home/<username>/.ssh to 700.

  • Go to the Google Cloud Console

  • Go to Compute Engine -> VM instances

  • Stop the VM instance

  • Click the Edit button

  • Scroll down to the section Custom metadata

  • For the key enter startup-script

  • Enter the following for the value replacing <username> with your username:

    #! /bin/bash

    chmod 700 /home/<username>/.ssh

  • Restart the instance

Another method is to use the VM serial console:

Troubleshooting using the serial console

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