This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| syno:dsm7rescue [2026/09/02 15:55] – Bernard Condrau | syno:dsm7rescue [2026/09/02 22:35] (current) – [Prepare DSM to get access through SSH with password login enabled] Bernard Condrau | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ===== Prepare DSM to get access through SSH with password login enabled ===== | ===== Prepare DSM to get access through SSH with password login enabled ===== | ||
| - | - Prepare 2 files within top level directory ''/ | + | - Prepare 2 files within top level directory ''/ |
| - | - Concept | + | - I wrote 2 shell files which run in ''/ |
| - | - File 1:< | + | - There are 3 files required to make this concept work, the first 2 which are '' |
| + | - Enable password login with '' | ||
| # | # | ||
| # This script checks availability of a fully encrypted volume1 and enables password authentication for SSH in case the volume is locked | # This script checks availability of a fully encrypted volume1 and enables password authentication for SSH in case the volume is locked | ||
| Line 52: | Line 53: | ||
| exit 1 | exit 1 | ||
| </ | </ | ||
| - | - File 2:< | + | - Query OTP with '' |
| # | # | ||
| # Query OTP | # Query OTP | ||
| Line 59: | Line 60: | ||
| # 2026-08-31: initial | # 2026-08-31: initial | ||
| # | # | ||
| - | OTPQ=" | + | OTPQ=" |
| AUTH=0; | AUTH=0; | ||
| CODE=" | CODE=" | ||
| Line 78: | Line 79: | ||
| exit 1 | exit 1 | ||
| </ | </ | ||
| - | - Set up a task in //Task Scheduler// of your DSM. | + | |
| + | /* | ||
| + | * php to deliver encryption key to remote NAS | ||
| + | * | ||
| + | * (c) 2026, Bernard Condrau | ||
| + | * | ||
| + | */ | ||
| + | |||
| + | // Build an array of trusted IP addresses... | ||
| + | $trusted=array(' | ||
| + | |||
| + | // check if request is made from valid ip address | ||
| + | if (in_array($_SERVER[' | ||
| + | $password = array( | ||
| + | ' | ||
| + | shell_exec('/ | ||
| + | ], | ||
| + | ); | ||
| + | // get the share name from the request | ||
| + | $share = $_GET[' | ||
| + | if (isset($password[$share]) && ($password[$share][0] == $_GET[' | ||
| + | echo $password[$share][1]; | ||
| + | exit(0); | ||
| + | } | ||
| + | } | ||
| + | echo ''; | ||
| + | ?></ | ||
| + | - Compute the OTP in '' | ||
| + | source / | ||
| + | python3 / | ||
| + | deactivate | ||
| + | exit 0</ | ||
| + | | ||
| ===== How to gain access to encrypted volumes when the KMIP Server was unavailable during DSM boot ===== | ===== How to gain access to encrypted volumes when the KMIP Server was unavailable during DSM boot ===== | ||