mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 06:06:32 +00:00
sshd: allow adding user options in /data/etc/sshd_config
This commit is contained in:
parent
9c96f22ed0
commit
e7f6389780
@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CONF="/etc/sshd_config"
|
SYS_CONF="/etc/sshd_config"
|
||||||
|
USER_CONF="/data/etc/sshd_config"
|
||||||
|
CONF="/var/run/sshd_config"
|
||||||
|
|
||||||
PROG="/usr/sbin/sshd"
|
PROG="/usr/sbin/sshd"
|
||||||
PROG_KG="/usr/bin/ssh-keygen"
|
PROG_KG="/usr/bin/ssh-keygen"
|
||||||
@ -10,7 +12,7 @@ test -x ${PROG} || exit 0
|
|||||||
|
|
||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
|
|
||||||
test -s ${CONF} || exit 0
|
test -s ${SYS_CONF} || exit 0
|
||||||
|
|
||||||
test "${OS_NETWORKLESS}" == "true" && exit 0
|
test "${OS_NETWORKLESS}" == "true" && exit 0
|
||||||
|
|
||||||
@ -18,6 +20,13 @@ test "${OS_NETWORKLESS}" == "true" && exit 0
|
|||||||
start() {
|
start() {
|
||||||
msg_begin "Starting sshd"
|
msg_begin "Starting sshd"
|
||||||
|
|
||||||
|
# merge user and sys conf files; options in first file take precedence
|
||||||
|
if [[ -s ${USER_CONF} ]]; then
|
||||||
|
cat ${USER_CONF} ${SYS_CONF} > ${CONF}
|
||||||
|
else
|
||||||
|
cp ${SYS_CONF} ${CONF}
|
||||||
|
fi
|
||||||
|
|
||||||
# create any missing keys
|
# create any missing keys
|
||||||
if ! ${PROG_KG} -A >/dev/null; then
|
if ! ${PROG_KG} -A >/dev/null; then
|
||||||
msg_fail
|
msg_fail
|
||||||
@ -57,4 +66,3 @@ case "$1" in
|
|||||||
echo "Usage: $0 {start|stop|restart}"
|
echo "Usage: $0 {start|stop|restart}"
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
Port 22
|
|
||||||
ListenAddress 0.0.0.0
|
ListenAddress 0.0.0.0
|
||||||
|
|
||||||
HostKey /data/etc/ssh_host_rsa_key
|
HostKey /data/etc/ssh_host_rsa_key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user