如果我将主目录的权限更改为777,该怎么办,而我的Google Cloud Server不再让我访问
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
您很可能更改了目录 .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