forked from finn/tinyboard
fix known_hosts ownership, ssh dir creation, and root user guard
This commit is contained in:
@@ -4,6 +4,12 @@ set -euo pipefail
|
||||
RCLONE_CONF="${HOME}/.config/rclone/rclone.conf"
|
||||
SSH_DIR="${HOME}/.ssh"
|
||||
|
||||
[ "$(id -u)" -eq 0 ] && echo -e "\033[0;31m[WARNING]\033[0m Running as root — keys will be written to /root/.ssh. Run as armbian instead." && exit 1 || true
|
||||
mkdir -p "$SSH_DIR"
|
||||
touch "$SSH_DIR/known_hosts"
|
||||
chmod 700 "$SSH_DIR"
|
||||
chmod 600 "$SSH_DIR/known_hosts"
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
|
||||
Reference in New Issue
Block a user