【问题标题】:Google Compute instance accidently chmod 0755 / folderGoogle Compute 实例意外 chmod 0755 / 文件夹
【发布时间】:2017-02-08 10:44:25
【问题描述】:

我不小心修改了 /0755 文件夹,我无法通过 SSH、Filezilla、SFTP 或通过 Google CLoud 命令访问我的实例,我想知道在这种情况下该怎么做。

谢谢!

【问题讨论】:

    标签: centos google-compute-engine google-cloud-platform sshd


    【解决方案1】:

    使用 Google 元数据启动脚本修复

    https://cloud.google.com/compute/docs/startupscript
    

    创建一个脚本并将其添加到元数据中:

    chmod -R go-w /
    chmod 440 /etc/sudoers
    chmod 640 /etc/shadow /etc/gshadow
    chmod 600 /etc/ssh/*_key /etc/ssh*key   # whichever matches
    chmod 710 /etc/ssl/private /etc/cups/ssl
    chmod 1777 /tmp /var/tmp /var/lock
    chmod 4755 /bin/su /usr/bin/passwd /usr/bin/sudo /usr/bin/sudoedit
    chmod 2755 /var/mail /var/spool/mail
    

    重启服务器,瞧!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-22
      • 2014-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-09
      • 2019-03-10
      • 2015-08-11
      相关资源
      最近更新 更多