From 0d10cf2150e9aadad7153d00ebd2acf67d4cbcff Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 14 Oct 2021 14:27:28 +0200 Subject: [sshd] Properly install sshd --- core/modules/sshd/TODO | 3 --- core/modules/sshd/data/etc/systemd/system/sshd.service | 11 +---------- core/modules/sshd/data/etc/tmpfiles.d/sshd.conf | 3 +-- core/modules/sshd/module.build | 11 +---------- core/modules/sshd/module.conf | 9 +++++++-- core/modules/sshd/module.conf.ubuntu | 4 ++++ 6 files changed, 14 insertions(+), 27 deletions(-) delete mode 100644 core/modules/sshd/TODO mode change 100644 => 120000 core/modules/sshd/data/etc/systemd/system/sshd.service create mode 100644 core/modules/sshd/module.conf.ubuntu (limited to 'core/modules/sshd') diff --git a/core/modules/sshd/TODO b/core/modules/sshd/TODO deleted file mode 100644 index b4e0a9c1..00000000 --- a/core/modules/sshd/TODO +++ /dev/null @@ -1,3 +0,0 @@ -make mltk install sshd if its not installed - -Distros: Ubuntu, Suse, soon Arch! diff --git a/core/modules/sshd/data/etc/systemd/system/sshd.service b/core/modules/sshd/data/etc/systemd/system/sshd.service deleted file mode 100644 index 999187cd..00000000 --- a/core/modules/sshd/data/etc/systemd/system/sshd.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=OpenSSH Daemon -Requires=systemd-tmpfiles-setup.service -After=systemd-tmpfiles-setup.service - -[Service] -ExecStart=/usr/sbin/sshd -D -ExecReload=/bin/kill -HUP $MAINPID -KillMode=process -Restart=always diff --git a/core/modules/sshd/data/etc/systemd/system/sshd.service b/core/modules/sshd/data/etc/systemd/system/sshd.service new file mode 120000 index 00000000..75049479 --- /dev/null +++ b/core/modules/sshd/data/etc/systemd/system/sshd.service @@ -0,0 +1 @@ +/lib/systemd/system/ssh.service \ No newline at end of file diff --git a/core/modules/sshd/data/etc/tmpfiles.d/sshd.conf b/core/modules/sshd/data/etc/tmpfiles.d/sshd.conf index ffb34ca6..26fc0b3a 100644 --- a/core/modules/sshd/data/etc/tmpfiles.d/sshd.conf +++ b/core/modules/sshd/data/etc/tmpfiles.d/sshd.conf @@ -1,3 +1,2 @@ -d /var/run/sshd 0755 root root -d /var/empty/sshd 0755 root root +d /run/sshd 0755 root root - diff --git a/core/modules/sshd/module.build b/core/modules/sshd/module.build index fed20806..4efccbe9 100644 --- a/core/modules/sshd/module.build +++ b/core/modules/sshd/module.build @@ -4,18 +4,9 @@ fetch_source() { } build() { - - local BIN_LOCATION="$(which sshd)" - [ ! -z "${BIN_LOCATION}" ] && BIN_LOCATION=$(readlink -f "$BIN_LOCATION") - if [ ! -z "${BIN_LOCATION}" -a -e "${BIN_LOCATION}" ]; then - tarcopy "${BIN_LOCATION}" "${MODULE_BUILD_DIR}" - else - perror "'sshd' not found on the system! Please install it." - fi + : } post_copy() { - mkdir -p "${TARGET_BUILD_DIR}/var/lib/empty" # suse - chmod -R go-rwx "${TARGET_BUILD_DIR}/etc/ssh" } diff --git a/core/modules/sshd/module.conf b/core/modules/sshd/module.conf index 33c7f30a..a4df03cf 100644 --- a/core/modules/sshd/module.conf +++ b/core/modules/sshd/module.conf @@ -1,4 +1,9 @@ #!/bin/bash -REQUIRED_BINARIES="sshd" REQUIRED_LIBRARIES="" -REQUIRED_DIRECTORIES="" +REQUIRED_BINARIES=" + sshd +" +REQUIRED_FILES=" + /lib/systemd/system/ssh.service + /usr/lib/openssh/ssh-session-cleanup +" diff --git a/core/modules/sshd/module.conf.ubuntu b/core/modules/sshd/module.conf.ubuntu new file mode 100644 index 00000000..31137b90 --- /dev/null +++ b/core/modules/sshd/module.conf.ubuntu @@ -0,0 +1,4 @@ +#!/bin/bash +REQUIRED_CONTENT_PACKAGES=" + openssh-server +" -- cgit v1.2.3-55-g7522