# Linux RSSH device/operator simulation

Simulates the **Android RSSH path** on a laptop with real OpenSSH client + optional local `sshd`.

## Prerequisites

- `curl`, `jq`, `sshpass` (for non-interactive sim)
- Backend reachable (`CRASHES_BASE` or default from `ra_lib.sh`)
- Admin whitelist + open session for the simulated `device_id`

## Device sim (heartbeat + reverse forward)

```bash
export CRASHES_BASE="http://cast01.intra.raptor.org/app/androidcast_project/crashes"
export RA_DEVICE_ID="linux-rssh-lab-01"

# 1) First run registers heartbeat (wait)
./ra_device_sim.sh

# 2) Whitelist device + open session in admin UI, then:
export RA_SKIP_ADMIN=1
./ra_device_sim.sh
```

## Operator sim (on bastion / BE)

After device sim prints `REMOTE_BIND_PORT` and username:

```bash
./ra_operator_connect.sh 18022 ra-SESSIONID shell
./ra_operator_connect.sh 18022 ra-SESSIONID sftp
```

## Android parity

| Android | Linux sim |
|---------|-----------|
| `RemoteAccessService` poll | `ra_ra_post` via `ra_lib.sh` |
| `RsshLocalSshServer` :8022 | local `sshd -p 8022` |
| `ReverseSshTunnelBridge` JSch `-R` | `ssh -N -R …` |

See [REMOTE_ACCESS_IMPL.md](../../../docs/REMOTE_ACCESS_IMPL.md) and [20260602_REVERSE_SSH_proposals_summary.md](../../../docs/20260602_REVERSE_SSH_proposals_summary.md).
