Switch user
high risk
sudo -u appuser <command>Prefer sudo for auditability`su -` starts a login shell as the target user.
| Flag | Meaning |
|---|---|
- | Login shell |
-c | Run one command |
-s | Shell to use |
su - appuserBecome appuser · explain & risk-check →su -c "id" appuserOne command as appuser · explain & risk-check →Reference text is hand-written and may be incomplete — check man su for your version. Test destructive commands on a non-production system first.