简体   繁体   English

通过SSH连接时我的密码是什么?

[英]What is my password when I connect via SSH?

I created a Debian VM in the Google Cloud, clicked on SSH from the GCP interface. 我在Google云端中创建了Debian VM,然后从GCP界面中单击SSH。 A console shell opened, no problem, I'm logged in. Now I want to use sudo: it asks me for my current password. 控制台外壳已打开,没问题,我已经登录。现在我想使用sudo:它要求我提供当前密码。 What is my password? 我的密码是多少? Also, what is the root password? 另外,root密码是什么?

The user account created by Google Compute Engine doesn't set a password. 由Google Compute Engine创建的用户帐户未设置密码。 As an implication it is impossible to use sudo and most screen-locking apps can't unlock. 这意味着无法使用sudo,并且大多数屏幕锁定应用程序都无法解锁。 To set password follow steps from the documentation : 要设置密码,请遵循文档中的步骤

  1. Connect to the instance using SSH, as you did when you first set up the instance. 像首次设置实例时一样,使用SSH连接到实例。 Here is the documentation how to connect using SSH . 这是如何使用SSH连接的文档
  2. Create a password for the user: sudo passwd $(whoami) 为用户创建密码: sudo passwd $(whoami)

Please note that this password will be also used on the screen lock. 请注意,此密码还将在屏幕锁上使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM