Spaces:
Sleeping
Sleeping
fix: chmod SSH host keys after restore (HF loses permissions)
Browse files- entrypoint.py +4 -0
entrypoint.py
CHANGED
|
@@ -167,6 +167,10 @@ def restore():
|
|
| 167 |
else:
|
| 168 |
log("── RESTORE: no package list")
|
| 169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
# Restart sshd to pick up restored host keys
|
| 171 |
sh("pkill sshd")
|
| 172 |
time.sleep(1)
|
|
|
|
| 167 |
else:
|
| 168 |
log("── RESTORE: no package list")
|
| 169 |
|
| 170 |
+
# Fix SSH key permissions (HF dataset doesn't preserve permissions)
|
| 171 |
+
sh("chmod 600 /etc/ssh/ssh_host_*_key 2>/dev/null")
|
| 172 |
+
sh("chmod 644 /etc/ssh/ssh_host_*_key.pub 2>/dev/null")
|
| 173 |
+
|
| 174 |
# Restart sshd to pick up restored host keys
|
| 175 |
sh("pkill sshd")
|
| 176 |
time.sleep(1)
|