mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 15:07:49 +00:00
openssh: ensure that $HOME/.ssh exists, is root-owned and not world-readable
This commit is contained in:
parent
f12e9df8c5
commit
e8b7ac9ec1
@ -29,6 +29,8 @@
|
||||
KEYGEN="/usr/bin/ssh-keygen"
|
||||
SSHD="/usr/sbin/sshd"
|
||||
|
||||
HOME="/storage"
|
||||
|
||||
(
|
||||
if [ "$SSH" = yes -o -f /storage/.config/ssh_enable ]; then
|
||||
|
||||
@ -59,12 +61,16 @@
|
||||
chmod 600 $DSA2_KEY
|
||||
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
|
||||
if [ -f /etc/ssh/known_hosts -a ! -f $HOME/.ssh/known_hosts ] ; then
|
||||
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
|
||||
|
||||
progress "Starting SSH Server"
|
||||
|
Loading…
x
Reference in New Issue
Block a user