Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efba61d10d | ||
|
|
ad3ba89a0c | ||
|
|
a5b7bc71d0 |
19
Makefile
19
Makefile
@@ -16,7 +16,7 @@ export URL = http://www.openssh.com/
|
|||||||
BRIEF = OpenSSH client and server
|
BRIEF = OpenSSH client and server
|
||||||
DESC = OpenSSH is the premier connectivity tool for remote login with the \
|
DESC = OpenSSH is the premier connectivity tool for remote login with the \
|
||||||
SSH protocol.
|
SSH protocol.
|
||||||
SNAPVER = 7
|
SNAPVER = 11
|
||||||
|
|
||||||
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1)
|
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1)
|
||||||
TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
|
TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
|
||||||
@@ -54,9 +54,12 @@ $(CLIENTROOT): $(SRCDIR)/sshd
|
|||||||
$(CLIENTROOT)/usr/share/openssh && \
|
$(CLIENTROOT)/usr/share/openssh && \
|
||||||
install -v -d $(SERVER)/SNAP && \
|
install -v -d $(SERVER)/SNAP && \
|
||||||
install -v -d $(SERVERROOT) && \
|
install -v -d $(SERVERROOT) && \
|
||||||
install -v -d -m 755 $(SERVERROOT)/etc/{ssh,init.d} && \
|
install -v -d -m 755 $(SERVERROOT)/etc/init.d && \
|
||||||
install -v -d -m 755 $(SERVERROOT)/usr/{libexec,sbin} && \
|
install -v -d -m 755 $(SERVERROOT)/etc/ssh && \
|
||||||
install -v -d -m 755 $(SERVERROOT)/usr/share/man/man{5,8} && \
|
install -v -d -m 755 $(SERVERROOT)/usr/libexec && \
|
||||||
|
install -v -d -m 755 $(SERVERROOT)/usr/sbin && \
|
||||||
|
install -v -d -m 755 $(SERVERROOT)/usr/share/man/man5 && \
|
||||||
|
install -v -d -m 755 $(SERVERROOT)/usr/share/man/man8 && \
|
||||||
install -v -d -m 755 $(SERVERROOT)/usr/share/openssh && \
|
install -v -d -m 755 $(SERVERROOT)/usr/share/openssh && \
|
||||||
install -v -m 755 $(PWD)/SNAP/sshd.init \
|
install -v -m 755 $(PWD)/SNAP/sshd.init \
|
||||||
$(SERVERROOT)/etc/init.d/sshd && \
|
$(SERVERROOT)/etc/init.d/sshd && \
|
||||||
@@ -74,13 +77,13 @@ $(CLIENTROOT): $(SRCDIR)/sshd
|
|||||||
cd $(CLIENT) && make -f ../Makefile.client && mv *.snap ../
|
cd $(CLIENT) && make -f ../Makefile.client && mv *.snap ../
|
||||||
|
|
||||||
$(SRCDIR)/configure: $(ARCHIVE)
|
$(SRCDIR)/configure: $(ARCHIVE)
|
||||||
@if [ '$(TYPE)' == 'application/x-bzip2' ]; then \
|
@if [ '$(TYPE)' = 'application/x-bzip2' ]; then \
|
||||||
tar -jxf $(ARCHIVE); \
|
tar -jxf $(ARCHIVE); \
|
||||||
elif [ '$(TYPE)' == 'application/x-gzip' ]; then \
|
elif [ '$(TYPE)' = 'application/x-gzip' ]; then \
|
||||||
tar -zxf $(ARCHIVE); \
|
tar -zxf $(ARCHIVE); \
|
||||||
elif [ '$(TYPE)' == 'application/x-tar' ]; then \
|
elif [ '$(TYPE)' = 'application/x-tar' ]; then \
|
||||||
tar -xf $(ARCHIVE); \
|
tar -xf $(ARCHIVE); \
|
||||||
elif [ '$(TYPE)' == 'application/x-xz' ]; then \
|
elif [ '$(TYPE)' = 'application/x-xz' ]; then \
|
||||||
tar -xf $(ARCHIVE); \
|
tar -xf $(ARCHIVE); \
|
||||||
else \
|
else \
|
||||||
echo 'Unable to determine archive type'; \
|
echo 'Unable to determine archive type'; \
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
REPO = main
|
||||||
BRIEF = OpenSSH client
|
BRIEF = OpenSSH client
|
||||||
DESC = The OpenSSH client provides a secure method of remotely \
|
DESC = The OpenSSH client provides a secure method of remotely \
|
||||||
accessing computer systems
|
accessing computer systems
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
REPO = server
|
||||||
|
DEPENDS = glibc,openssh-client,openssl,shadow,zlib
|
||||||
BRIEF = OpenSSH server
|
BRIEF = OpenSSH server
|
||||||
DESC = The OpenSSH server allows remote users to access the system securely
|
DESC = The OpenSSH server allows remote users to access the system securely
|
||||||
|
|
||||||
|
|||||||
70
SNAP/usher
70
SNAP/usher
@@ -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
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -7,8 +7,8 @@ case $1 in
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
postinst)
|
postinst)
|
||||||
if [ ! -f ${TARGET}/etc/ssh/ssh_config ]; then
|
if [ ! -f /etc/ssh/ssh_config ]; then
|
||||||
cp ${TARGET}/usr/share/openssh/ssh_config ${TARGET}/etc/ssh
|
cp /usr/share/openssh/ssh_config /etc/ssh
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
prerm)
|
prerm)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@@ -7,54 +7,30 @@ case $1 in
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
postinst)
|
postinst)
|
||||||
if [[ ${TARGET} ]]; then
|
if ! getent group sshd 2>&1 > /dev/null; then
|
||||||
if ! chroot ${TARGET} 'getent group sshd 2>&1' > /dev/null; then
|
if groupadd -g 50 sshd; then
|
||||||
if chroot ${TARGET} 'groupadd -g 50 sshd'; then
|
echo 'Created group sshd'
|
||||||
echo 'Created group sshd'
|
else
|
||||||
else
|
echo 'Failed to create group sshd!'
|
||||||
echo 'Failed to create group sshd!'
|
exit 1
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
if ! chroot ${TARGET} 'getent passwd sshd 2>&1 > /dev/null'; then
|
fi
|
||||||
if chroot ${TARGET} 'useradd -c "sshd PrivSep" \
|
if ! getent passwd sshd 2>&1 > /dev/null; then
|
||||||
-d /var/run/sshd -g sshd -s /bin/false -u 50 sshd'; then
|
if useradd -c 'sshd PrivSep' -d /var/run/sshd -g sshd \
|
||||||
echo 'Created user sshd'
|
-s /bin/false -u 50 sshd; then
|
||||||
else
|
echo 'Created user sshd'
|
||||||
echo 'Failed to create user sshd!'
|
else
|
||||||
exit 1
|
echo 'Failed to create user sshd!'
|
||||||
fi
|
exit 1
|
||||||
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f ${TARGET}/etc/ssh/sshd_config ]; then
|
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
|
||||||
cp ${TARGET}/usr/share/openssh/sshd_config ${TARGET}/etc/ssh
|
ssh-keygen -A
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f /etc/ssh/sshd_config ]; then
|
||||||
|
cp /usr/share/openssh/sshd_config /etc/ssh
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
prerm)
|
prerm)
|
||||||
|
|||||||
Reference in New Issue
Block a user