The registry records the intended/completed user state; the log records what the scripts actually did and when.
---
## 10. External user directory permissions
Each external user receives:
```text
/lafi/srv_data/<username>
```
with mode:
```text
2755
```
Typical representation:
```text
drwxr-sr-x username username
```
The tested behavior is:
| Operation | Own directory | Another external user's directory |
|---|---:|---:|
| List | yes | yes |
| Read/download | yes | yes |
| Upload | yes | no |
| Modify | yes | no |
| Delete file | yes | no |
| Rename file | yes | no |
| Rename another user's top-level directory | no | no |
The top-level directory name is treated as canonical:
```text
/lafi/srv_data/<username>
```
An administrator can technically rename it with `sudo`, but doing so would conflict with the provisioning logic because the script expects the canonical directory to exist.
---
## 11. SSH policy
External users belong to:
```text
lafi_sftp
```
The SSH drop-in is:
```text
/etc/ssh/sshd_config.d/60-lafi-sftp.conf
```
with:
```text
Match Group lafi_sftp
ChrootDirectory /srv/sftp
ForceCommand internal-sftp -d /lafi -u 022
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yes
AllowTcpForwarding no
X11Forwarding no
AllowAgentForwarding no
PermitTunnel no
```
This provides:
- key-only authentication;
- SFTP-only access;
- no interactive terminal;
- no forwarding or tunnelling;
- automatic start in `/lafi`;
- uploaded file umask `022`.
---
## 12. Validation completed
The complete process was tested with:
```text
lafi_testuser01
lafi_testuser02
lafi_testuser03
lafi_testuser04
```
The following were validated:
- existing-user verification;
- new-user creation;
- public-key installation;
- effective SSH/SFTP restrictions;
- matching UID/GID creation on both hosts;
- LAFO data-directory creation;
- correct `2755` ownership/permissions;
-`date_added` update;
- dry-run behavior;
- provisioning logs;
- repeated idempotent runs;
- cross-user read/write restrictions;
- complete end-to-end SFTP access from an external workstation.
---
## 13. Operational rules
1. Start every provisioning cycle with synchronized registries.
2. Add new users to the THREDDS working registry.
3. Run dry-run before every real provisioning run.
4. Never reuse a UID/GID without checking both systems.
5. Never store private SSH keys.
6. Only public keys belong in the registry.
7. Treat `/lafi/srv_data/<username>` as the canonical managed directory.
8. Do not silently modify unexpected existing account state.
9. Copy the LAFO-completed registry back to THREDDS after provisioning.
10. Confirm registry synchronization again before the next cycle.