Google Compute Engine:修订间差异

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
无编辑摘要
第1行: 第1行:
'''Google Compute Engine'''。
'''Google Compute Engine''' 是[[GCP]]的VM類服務


== 範例 ==
== 範例 ==
第13行: 第13行:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
echo "%staff ALL = (ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/group-staff
echo "%staff ALL = (ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/group-staff
</syntaxhighlight>
安裝<code>gcloud</code>指令:
<syntaxhighlight lang="bash">
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list; curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo tee /usr/share/keyrings/cloud.google.gpg; sudo apt update; sudo apt install -y google-cloud-cli; sudo apt clean
</syntaxhighlight>
</syntaxhighlight>



2023年3月29日 (三) 09:13的版本

Google Compute EngineGCP的VM类服务。

范例

关闭GCE的自动建立账号以及SSH key机制:

echo -e '[Daemons]\naccounts_daemon = false' | sudo tee /etc/default/instance_configs.cfg; sudo reboot

所有在staff群组的人都可以无限制sudo:

echo "%staff ALL = (ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/group-staff

安装gcloud指令:

echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list; curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo tee /usr/share/keyrings/cloud.google.gpg; sudo apt update; sudo apt install -y google-cloud-cli; sudo apt clean

外部链接