Moved config files to /usr/share/openssh - will manage with usher
This commit is contained in:
18
SNAP/usher
18
SNAP/usher
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
case $1 in
|
||||
preinst)
|
||||
exit 0
|
||||
@@ -27,6 +29,14 @@ case $1 in
|
||||
if [ ! -f ${TARGET}/etc/ssh/ssh_host_rsa_key ]; then
|
||||
chroot ${TARGET} 'ssh-keygen -A'
|
||||
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
|
||||
else
|
||||
if ! getent group sshd 2>&1 > /dev/null; then
|
||||
if groupadd -g 50 sshd; then
|
||||
@@ -49,6 +59,14 @@ case $1 in
|
||||
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
|
||||
ssh-keygen -A
|
||||
fi
|
||||
|
||||
if [ ! -f /etc/ssh/ssh_config ]; then
|
||||
cp /usr/share/openssh/ssh_config /etc/ssh
|
||||
fi
|
||||
|
||||
if [ ! -f /etc/ssh/sshd_config ]; then
|
||||
cp /usr/share/openssh/sshd_config /etc/ssh
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
prerm)
|
||||
|
||||
Reference in New Issue
Block a user