Skip to content

Commit 457a580

Browse files
SSH is installed but disabled by default, and keys are sanitized with a sanity check.
debos: install openssh-server disabled-by-default and sanitize SSH keys Install openssh-server for convenience while ensuring it is disabled by default. Remove host keys generated during build and add a sanity check to prevent shipping images with pre-generated SSH keys. Signed-off-by: Niranjan <nvemana@qti.qualcomm.com>
1 parent 2887a13 commit 457a580

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ For the flash recipe:
148148
- `target_boards`: comma-separated list of board names to build (default: `all`). Accepted values are the board names defined in the flash recipe, e.g. `qcs615-ride`, `qcs6490-rb3gen2-vision-kit`, `qcs8300-ride`, `qcs9100-ride-r3`, `qrb2210-rb1`.
149149

150150
Note: Boards whose required device tree (.dtb) is not present in `dtbs.tar.gz` are automatically skipped during flash asset generation.
151+
Note: "A SSH server is installed but disabled by default; enable with sudo systemctl enable ssh".
151152

152153
Deprecated flash options:
153154
- `build_qcs615`, `build_qcm6490`, `build_qcs8300`, `build_qcs9100`, `build_rb1`: these per-family/per-board toggles are deprecated and will be removed. Use `target_boards` instead to select which boards to build.

debos-recipes/qualcomm-linux-debian-rootfs.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ actions:
189189
# convenience networking commands (arp, ifconfig, route etc.)
190190
- net-tools
191191
- openssh-client
192+
# A SSH server is installed but disabled by default; enable with sudo systemctl enable ssh.
193+
- openssh-server
192194
# lspci
193195
- pciutils
194196
- rfkill
@@ -201,6 +203,16 @@ actions:
201203
- vulkan-tools
202204
- wget
203205

206+
- action: run
207+
description: Sanitize SSH setup
208+
chroot: true
209+
command: |
210+
set -eux
211+
rm -v /etc/ssh/ssh_host_* || true
212+
# rm -rf /root/.ssh /home/*/.ssh || true
213+
systemctl disable ssh 2>/dev/null || true # it's not actually started after install in the debos environment.
214+
find /etc/ssh /root /home -type f \( -name 'ssh_host_*' -o -name 'id_rsa*' -o -name 'id_ed25519*' -o -name 'authorized_keys' \) -exec rm -v {} + 2>/dev/null || true
215+
204216
- action: run
205217
description: Add default user to docker group
206218
chroot: true

0 commit comments

Comments
 (0)