我创建了一个全新的 Google Compute Engine VM (Debian 9) 并使用 GoogleCloud shell 打开了一个 shell。我可以sudo
从那个浏览器外壳窗口。
然后我将我的 ssh 密钥和 ssh 设置到虚拟机中。为了便于讨论,我的用户名是“user123”。我使用以下 SSH 连接到我的 GCP 虚拟机:
ssh user123@1.2.3.4
其中 1.2.3.4 是我的 GCP 外部 IP 地址。然后我登录了。
所以当用户user123
在GoogleCloudShell sudo
工作,但通过登录时的ssh的user123
,我提示输入密码。
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great …
Run Code Online (Sandbox Code Playgroud)