by blackboxsoc
# FTPS Deploy (Explicit TLS) — Push Static + PHP Safely
## Why
If you can upload over FTPS, you can ship updates without complicated CI.
## Recipe (Python)
```python
import ftplib
def upload(host, user, pw, local_path, remote_path):
ftps = ftplib.FTP_TLS()
ftps.connect(host, 21, timeout=30)
ftps.auth(); ftps.prot_p(); ftps.login(user, pw)
with open(local_path, 'rb') as f:
ftps.storbinary('STOR ' + remote_path, f)
ftps.quit()
```
## Hardening
- deny `/data/*` via `.htaccess`
- keep private keys server-side