mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 13:23:08 +00:00
tools: examples: network - uncomment RSA and add info
Uncommented the line that injetcs the RSA key to allow for SSH connections to the VM without initial login. Add more information that if the file is missing, an initial login to change passwords is required. BUG=N/A TEST=mdbook build Change-Id: Ie0f94da693e04319b7b098df8bfe044ceeeeb8a9 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4698613 Commit-Queue: Elie Kheirallah <khei@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
e168a15cee
commit
1a41931529
1 changed files with 9 additions and 3 deletions
|
@ -22,13 +22,19 @@ if ! [ -f rootfs ]; then
|
|||
# $SRC=/path/to/crosvm
|
||||
--copy-in "$SRC/guest/01-netcfg.yaml:/etc/netplan/"
|
||||
|
||||
# Install sshd and authorized key for the user.
|
||||
# Install sshd.
|
||||
--install openssh-server
|
||||
# OPTIONAL: inject RSA public key as known key
|
||||
# --ssh-inject "$USER:file:$HOME/.ssh/id_rsa.pub"
|
||||
|
||||
-o rootfs
|
||||
)
|
||||
|
||||
# Inject authorized key for the user.
|
||||
# If the SSH RSA public key file is missing, you will need to login to
|
||||
# the VM the first time and change passwords before you can login via SSH.
|
||||
ID_RSA_PUB="$HOME/.ssh/id_rsa.pub"
|
||||
if [ -r "${ID_RSA_PUB}" ]; then
|
||||
builder_args+=("--ssh-inject" "${USER}:file:${ID_RSA_PUB}")
|
||||
fi
|
||||
virt-builder ubuntu-20.04 "${builder_args[@]}"
|
||||
# ANCHOR_END: build
|
||||
|
||||
|
|
Loading…
Reference in a new issue