mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 15:07:49 +00:00
Merge pull request #283 from stefansaraev/ssh
openssh: ensure that $HOME/.ssh exists, is root-owned and not world-readable
This commit is contained in:
commit
109e408769
@ -29,6 +29,8 @@
|
|||||||
KEYGEN="/usr/bin/ssh-keygen"
|
KEYGEN="/usr/bin/ssh-keygen"
|
||||||
SSHD="/usr/sbin/sshd"
|
SSHD="/usr/sbin/sshd"
|
||||||
|
|
||||||
|
HOME="/storage"
|
||||||
|
|
||||||
(
|
(
|
||||||
if [ "$SSH" = yes -o -f /storage/.config/ssh_enable ]; then
|
if [ "$SSH" = yes -o -f /storage/.config/ssh_enable ]; then
|
||||||
|
|
||||||
@ -59,12 +61,16 @@
|
|||||||
chmod 600 $DSA2_KEY
|
chmod 600 $DSA2_KEY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# ensure that $HOME/.ssh exists, is root-owned and not world-readable
|
||||||
|
mkdir -p $HOME/.ssh
|
||||||
|
chown root:root $HOME/.ssh
|
||||||
|
chmod 0700 $HOME/.ssh
|
||||||
|
|
||||||
# Check for predefined known hosts file
|
# Check for predefined known hosts file
|
||||||
if [ -f /etc/ssh/known_hosts -a ! -f $HOME/.ssh/known_hosts ] ; then
|
if [ -f /etc/ssh/known_hosts -a ! -f $HOME/.ssh/known_hosts ] ; then
|
||||||
progress "SSH: setup predefined known hosts"
|
progress "SSH: setup predefined known hosts"
|
||||||
|
|
||||||
mkdir -p /$HOME/.ssh
|
cp /etc/ssh/known_hosts $HOME/.ssh
|
||||||
cp /etc/ssh/known_hosts $HOME/.ssh
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
progress "Starting SSH Server"
|
progress "Starting SSH Server"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user