Skip to content

Commit 7e9bb29

Browse files
feat(debos/rootfs): add openssh-server and disable it by default.
Add the openssh server to support external ssh connections, disable it by default, and add a sanity check to error out if ssh host keys are generated during build or install, preventing unintended remote access and shipping pre-generated ssh identities. Signed-off-by: Niranjan Vemana <nvemana@qti.qualcomm.com>
1 parent 874cb4c commit 7e9bb29

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ Once the image has booted, you can log in as the `debian` user, with the
263263
default `debian` password. The image should then ask you to change this default
264264
password to a safe one.
265265
266+
Note: "openssh server is installed but disabled by default; enable with "systemctl enable --now ssh" as root user".
267+
266268
## Development
267269
268270
Want to join in the development? Changes welcome! See [CONTRIBUTING.md file](CONTRIBUTING.md) for step by step instructions.

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ actions:
200200
# convenience networking commands (arp, ifconfig, route etc.)
201201
- net-tools
202202
- openssh-client
203+
# disabled by default
204+
- openssh-server
203205
# lspci
204206
- pciutils
205207
- rfkill
@@ -212,6 +214,19 @@ actions:
212214
- vulkan-tools
213215
- wget
214216

217+
- action: run
218+
description: Disable ssh by default and sanitize ssh keys
219+
chroot: true
220+
command: |
221+
set -eux
222+
systemctl disable --now ssh
223+
for keyfile in /etc/ssh/ssh_host_*_key; do
224+
if [ -f ${keyfile} ]; then
225+
echo "ERROR: SSH host key ($(basename ${keyfile})) was unexpectedly generated" >&2
226+
exit 1
227+
fi
228+
done
229+
215230
- action: run
216231
description: Add default user to docker group
217232
chroot: true

0 commit comments

Comments
 (0)