「Google Compute Engine」:修訂間差異
跳至導覽
跳至搜尋
無編輯摘要 |
|||
第18行: | 第18行: | ||
<syntaxhighlight lang="bash"> | <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 | 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 > /dev/null; sudo apt update; sudo apt install -y google-cloud-cli; sudo apt clean | ||
</syntaxhighlight> | </syntaxhighlight> | ||
於 2023年3月29日 (三) 09:13 的修訂
Google Compute Engine是GCP的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 > /dev/null; sudo apt update; sudo apt install -y google-cloud-cli; sudo apt clean