mirror of
https://github.com/fire1ce/UDM-Persistent-SSH-Keys.git
synced 2023-10-10 11:36:54 +00:00
initial release
This commit is contained in:
parent
b3345f396c
commit
231593868a
@ -3,4 +3,11 @@
|
|||||||
## Persistence on Reboot
|
## Persistence on Reboot
|
||||||
|
|
||||||
The setup script must be run every time the system is rebooted since the __/root/.ssh/authorized_keys__ overwrites every boot.
|
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}
|
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))
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
```
|
@ -2,14 +2,18 @@
|
|||||||
|
|
||||||
user_authorized_keys_file="/mnt/data/ssh/authorized_keys"
|
user_authorized_keys_file="/mnt/data/ssh/authorized_keys"
|
||||||
|
|
||||||
curl -O https://raw.githubusercontent.com/fire1ce/
|
curl -O https://raw.githubusercontent.com/fire1ce/UDMP-Persistence-SSH-Keys/main/99-ssh-keys.sh
|
||||||
mv 99-ssh-keys.sh /mnt/data/on_boot.d/99-ssh-keys.sh
|
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
|
chmod +x /mnt/data/on_boot.d/99-ssh-keys.sh
|
||||||
|
echo "99-ssh-keys.sh installed"
|
||||||
|
|
||||||
if [ ! -f "$user_authorized_keys_file" ]; then
|
if [ ! -f "$user_authorized_keys_file" ]; then
|
||||||
touch $user_authorized_keys_file
|
touch $user_authorized_keys_file
|
||||||
|
echo "Creating $user_authorized_keys_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod 0644 $user_authorized_keys_file
|
chmod 0644 $user_authorized_keys_file
|
||||||
|
|
||||||
|
echo "Add you public keys to $user_authorized_keys_file"
|
||||||
|
echo "done."
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user