initial release

This commit is contained in:
fire1ce 2022-02-12 23:11:35 +02:00
parent 10c03e7f57
commit b3345f396c
4 changed files with 65 additions and 1 deletions

26
.gitignore vendored Normal file
View File

@ -0,0 +1,26 @@
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

18
99-ssh-keys.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
user_authorized_keys_file="/mnt/data/ssh/authorized_keys"
udm_authorized_keys_file="/root/.ssh/authorized_keys"
# if /mnt/data/ssh/authorized_keys is missing print error message
if [ ! -f "$user_authorized_keys_file" ]; then
echo "ERROR: $user_authorized_keys_file is missing"
exit 1
fi
# Reads the user file line by line and adds the key to the authorized_keys file
file=$user_authorized_keys_file
while IFS= read -r line || [ -n "$line" ]; do
echo $line >>$udm_authorized_keys_file
done <"$file"
exit 0

View File

@ -1 +1,6 @@
# UDMP-Persistence-SSH-Keys
# UDMP Persistence SSH Keys
## Persistence on Reboot
The setup script must be run every time the system is rebooted since the __/root/.ssh/authorized_keys__ overwrites every boot.
This can be accomplished with a boot script. Flow its guide [UDM / UDMPro Boot Script]([UDM / UDMPro Boot Script](https://github.com/boostchicken-dev/udm-utilities/tree/master/on-boot-script)){target=_blank}

15
install.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
user_authorized_keys_file="/mnt/data/ssh/authorized_keys"
curl -O https://raw.githubusercontent.com/fire1ce/
mv 99-ssh-keys.sh /mnt/data/on_boot.d/99-ssh-keys.sh
chmod +x /mnt/data/on_boot.d/99-ssh-keys.sh
if [ ! -f "$user_authorized_keys_file" ]; then
touch $user_authorized_keys_file
fi
chmod 0644 $user_authorized_keys_file
exit 0