The key that the website logs in with lives in the home directory of the user, so a deleted home directory took it away and the site could not connect any more. The key is now one of the copies the cleanup restores, and it is merged into the authorized_keys of the user, so that keys they added stay. The installer writes the same key for the Administrator, and the deploy script checks that it is the key the website uses. Co-Authored-By: Claude Code <noreply@anthropic.com>
13 lines
716 B
Batchfile
13 lines
716 B
Batchfile
@echo off
|
|
REM Puts the SSH access back that a deleted home directory took with it: the key the website logs in with, in the
|
|
REM home of the root user and in the home of the Administrator. Run it as Administrator on the box, for example
|
|
REM over RDP. The cleanup job puts the key back by itself from then on.
|
|
set KEY=ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJDweEH8bhZAHVaAedhTVDb2j/oMEn3vm97xCwCw9LC9 root@nowhere.wirs.ing cygwin-2222
|
|
|
|
if not exist C:\msys2\home\root\.ssh mkdir C:\msys2\home\root\.ssh
|
|
> C:\msys2\home\root\.ssh\authorized_keys echo %KEY%
|
|
|
|
if not exist C:\Users\Administrator\.ssh mkdir C:\Users\Administrator\.ssh
|
|
>> C:\Users\Administrator\.ssh\authorized_keys echo %KEY%
|
|
|
|
echo The SSH access is back.
|