「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

外部連結