From b3bbf8c5aafed7a866468744b054918dd1df707c Mon Sep 17 00:00:00 2001 From: Tero Huttunen Date: Thu, 1 Oct 2026 12:53:31 +0300 Subject: [PATCH] Add ability to use SSH and Telnet --- README.md | 4 ++++ .../normal/5070-enable-remote-access.hook.chroot | 8 ++++++++ config/includes.chroot/etc/inetd.conf | 1 + .../etc/ssh/sshd_config.d/10-ep-eraser.conf | 5 +++++ config/includes.chroot/etc/sudoers.d/ep-eraser | 1 + .../systemd/system/ep-eraser-remote-access.service | 13 +++++++++++++ .../usr/local/sbin/ep-eraser-remote-setup | 4 ++++ config/package-lists/ep-eraser.list.chroot | 10 ++++++++++ 8 files changed, 46 insertions(+) create mode 100644 config/hooks/normal/5070-enable-remote-access.hook.chroot create mode 100644 config/includes.chroot/etc/inetd.conf create mode 100644 config/includes.chroot/etc/ssh/sshd_config.d/10-ep-eraser.conf create mode 100644 config/includes.chroot/etc/sudoers.d/ep-eraser create mode 100644 config/includes.chroot/etc/systemd/system/ep-eraser-remote-access.service create mode 100644 config/includes.chroot/usr/local/sbin/ep-eraser-remote-setup diff --git a/README.md b/README.md index 8e9c010..7064b4f 100644 --- a/README.md +++ b/README.md @@ -38,4 +38,8 @@ Choose `nwipe` from the startup menu to use its interactive interface. Its PDF c To brand certificates, place your JPEG logo at `config/includes.chroot/etc/nwipe/logo.jpg` before building. Nwipe is built from upstream v0.42, which supports this `logo.jpg` branding file. You can also include `/etc/nwipe/nwipe.conf` in `config/includes.chroot` to ship default certificate settings. +NetworkManager provides network connectivity; wired Ethernet uses DHCP automatically, and Wi-Fi can be configured with `nmcli device wifi list` followed by `nmcli device wifi connect "SSID" --ask`. The image starts SSH and Telnet servers for the `eraser` account with password `eperaser`; root SSH login is disabled. The account can run only the EP Eraser and nwipe programs through passwordless `sudo`, for example `sudo -n /usr/local/sbin/ep-eraser` or `sudo -n /usr/local/bin/nwipe`. + +Telnet sends both passwords and commands without encryption. Use it only on an isolated, trusted internal network; anyone able to monitor that network can capture the credentials. The predefined password is shared by every image built from this configuration, so change it in `config/includes.chroot/usr/local/sbin/ep-eraser-remote-setup` before deploying outside a controlled test environment. Connect with `ssh -t eraser@HOST` or `telnet HOST`. + This project intentionally does not include an automatic wipe-all mode. \ No newline at end of file diff --git a/config/hooks/normal/5070-enable-remote-access.hook.chroot b/config/hooks/normal/5070-enable-remote-access.hook.chroot new file mode 100644 index 0000000..41b780e --- /dev/null +++ b/config/hooks/normal/5070-enable-remote-access.hook.chroot @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +chmod 0755 /usr/local/sbin/ep-eraser-remote-setup +chmod 0440 /etc/sudoers.d/ep-eraser +visudo --check --file=/etc/sudoers +sshd -t +systemctl enable ep-eraser-remote-access.service ssh.service openbsd-inetd.service \ No newline at end of file diff --git a/config/includes.chroot/etc/inetd.conf b/config/includes.chroot/etc/inetd.conf new file mode 100644 index 0000000..1f7856f --- /dev/null +++ b/config/includes.chroot/etc/inetd.conf @@ -0,0 +1 @@ +telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.telnetd \ No newline at end of file diff --git a/config/includes.chroot/etc/ssh/sshd_config.d/10-ep-eraser.conf b/config/includes.chroot/etc/ssh/sshd_config.d/10-ep-eraser.conf new file mode 100644 index 0000000..f019d0b --- /dev/null +++ b/config/includes.chroot/etc/ssh/sshd_config.d/10-ep-eraser.conf @@ -0,0 +1,5 @@ +PermitRootLogin no +PasswordAuthentication yes +KbdInteractiveAuthentication no +PermitEmptyPasswords no +AllowUsers eraser \ No newline at end of file diff --git a/config/includes.chroot/etc/sudoers.d/ep-eraser b/config/includes.chroot/etc/sudoers.d/ep-eraser new file mode 100644 index 0000000..4f73f4e --- /dev/null +++ b/config/includes.chroot/etc/sudoers.d/ep-eraser @@ -0,0 +1 @@ +eraser ALL=(root) NOPASSWD: /usr/local/sbin/ep-eraser, /usr/local/bin/nwipe \ No newline at end of file diff --git a/config/includes.chroot/etc/systemd/system/ep-eraser-remote-access.service b/config/includes.chroot/etc/systemd/system/ep-eraser-remote-access.service new file mode 100644 index 0000000..4f5ffbc --- /dev/null +++ b/config/includes.chroot/etc/systemd/system/ep-eraser-remote-access.service @@ -0,0 +1,13 @@ +[Unit] +Description=Configure EP Eraser remote login +Requires=live-config.service +After=live-config.service +Before=ssh.service openbsd-inetd.service + +[Service] +Type=oneshot +ExecStart=/usr/local/sbin/ep-eraser-remote-setup +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/config/includes.chroot/usr/local/sbin/ep-eraser-remote-setup b/config/includes.chroot/usr/local/sbin/ep-eraser-remote-setup new file mode 100644 index 0000000..563d40a --- /dev/null +++ b/config/includes.chroot/usr/local/sbin/ep-eraser-remote-setup @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +printf '%s\n' 'eraser:eperaser' | chpasswd \ No newline at end of file diff --git a/config/package-lists/ep-eraser.list.chroot b/config/package-lists/ep-eraser.list.chroot index 6de4b1c..f05bf23 100644 --- a/config/package-lists/ep-eraser.list.chroot +++ b/config/package-lists/ep-eraser.list.chroot @@ -1,11 +1,21 @@ bash coreutils hdparm +inetutils-telnet +inetutils-telnetd +iproute2 libconfig11 libncurses6 libparted2t64 +network-manager nvme-cli +openssh-client +openssh-server +openbsd-inetd parted smartmontools +sudo util-linux +wireless-regdb +wpasupplicant whiptail \ No newline at end of file