diff --git a/Makefile b/Makefile index be57430..6652f05 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ export URL = http://www.openssh.com/ BRIEF = OpenSSH client and server DESC = OpenSSH is the premier connectivity tool for remote login with the \ SSH protocol. -SNAPVER = 8 +SNAPVER = 10 ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1) TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n') diff --git a/Makefile.server b/Makefile.server index ff43c57..a25945b 100644 --- a/Makefile.server +++ b/Makefile.server @@ -8,7 +8,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -DEPENDS = glibc,openssh-client,openssl,zlib +DEPENDS = glibc,openssh-client,openssl,shadow,zlib BRIEF = OpenSSH server DESC = The OpenSSH server allows remote users to access the system securely diff --git a/SNAP/usher b/SNAP/usher deleted file mode 100755 index b38b878..0000000 --- a/SNAP/usher +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -set -e - -case $1 in - preinst) - exit 0 - ;; - postinst) - if [[ ${TARGET} ]]; then - if ! chroot ${TARGET} 'getent group sshd 2>&1' > /dev/null; then - if chroot ${TARGET} 'groupadd -g 50 sshd'; then - echo 'Created group sshd' - else - echo 'Failed to create group sshd!' - exit 1 - fi - fi - if ! chroot ${TARGET} 'getent passwd sshd 2>&1 > /dev/null'; then - if chroot ${TARGET} 'useradd -c "sshd PrivSep" \ - -d /var/run/sshd -g sshd -s /bin/false -u 50 sshd'; then - echo 'Created user sshd' - else - echo 'Failed to create user sshd!' - exit 1 - fi - fi - - if [ ! -f ${TARGET}/etc/ssh/ssh_host_rsa_key ]; then - chroot ${TARGET} 'ssh-keygen -A' - fi - else - if ! getent group sshd 2>&1 > /dev/null; then - if groupadd -g 50 sshd; then - echo 'Created group sshd' - else - echo 'Failed to create group sshd!' - exit 1 - fi - fi - if ! getent passwd sshd 2>&1 > /dev/null; then - if useradd -c 'sshd PrivSep' -d /var/run/sshd -g sshd \ - -s /bin/false -u 50 sshd; then - echo 'Created user sshd' - else - echo 'Failed to create user sshd!' - exit 1 - fi - fi - - if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then - ssh-keygen -A - fi - fi - - if [ ! -f ${TARGET}/etc/ssh/ssh_config ]; then - cp ${TARGET}/usr/share/openssh/ssh_config ${TARGET}/etc/ssh - fi - - if [ ! -f ${TARGET}/etc/ssh/sshd_config ]; then - cp ${TARGET}/usr/share/openssh/sshd_config ${TARGET}/etc/ssh - fi - ;; - prerm) - exit 0 - ;; - postrm) - exit 0 - ;; -esac diff --git a/SNAP/usher-client b/SNAP/usher-client index f7a3089..2989f7b 100755 --- a/SNAP/usher-client +++ b/SNAP/usher-client @@ -7,8 +7,8 @@ case $1 in exit 0 ;; postinst) - if [ ! -f ${TARGET}/etc/ssh/ssh_config ]; then - cp ${TARGET}/usr/share/openssh/ssh_config ${TARGET}/etc/ssh + if [ ! -f /etc/ssh/ssh_config ]; then + cp /usr/share/openssh/ssh_config /etc/ssh fi ;; prerm) diff --git a/SNAP/usher-server b/SNAP/usher-server index 6520de5..fad9574 100755 --- a/SNAP/usher-server +++ b/SNAP/usher-server @@ -7,54 +7,30 @@ case $1 in exit 0 ;; postinst) - if [[ ${TARGET} ]]; then - if ! chroot ${TARGET} 'getent group sshd 2>&1' > /dev/null; then - if chroot ${TARGET} 'groupadd -g 50 sshd'; then - echo 'Created group sshd' - else - echo 'Failed to create group sshd!' - exit 1 - fi + if ! getent group sshd 2>&1 > /dev/null; then + if groupadd -g 50 sshd; then + echo 'Created group sshd' + else + echo 'Failed to create group sshd!' + exit 1 fi - if ! chroot ${TARGET} 'getent passwd sshd 2>&1 > /dev/null'; then - if chroot ${TARGET} 'useradd -c "sshd PrivSep" \ - -d /var/run/sshd -g sshd -s /bin/false -u 50 sshd'; then - echo 'Created user sshd' - else - echo 'Failed to create user sshd!' - exit 1 - fi - fi - - if [ ! -f ${TARGET}/etc/ssh/ssh_host_rsa_key ]; then - chroot ${TARGET} 'ssh-keygen -A' - fi - else - if ! getent group sshd 2>&1 > /dev/null; then - if groupadd -g 50 sshd; then - echo 'Created group sshd' - else - echo 'Failed to create group sshd!' - exit 1 - fi - fi - if ! getent passwd sshd 2>&1 > /dev/null; then - if useradd -c 'sshd PrivSep' -d /var/run/sshd -g sshd \ - -s /bin/false -u 50 sshd; then - echo 'Created user sshd' - else - echo 'Failed to create user sshd!' - exit 1 - fi - fi - - if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then - ssh-keygen -A + fi + if ! getent passwd sshd 2>&1 > /dev/null; then + if useradd -c 'sshd PrivSep' -d /var/run/sshd -g sshd \ + -s /bin/false -u 50 sshd; then + echo 'Created user sshd' + else + echo 'Failed to create user sshd!' + exit 1 fi fi - if [ ! -f ${TARGET}/etc/ssh/sshd_config ]; then - cp ${TARGET}/usr/share/openssh/sshd_config ${TARGET}/etc/ssh + if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then + ssh-keygen -A + fi + + if [ ! -f /etc/ssh/sshd_config ]; then + cp /usr/share/openssh/sshd_config /etc/ssh fi ;; prerm)