notes
notes copied to clipboard
linux 下以 nologin 账户身份运行 or linux nologin user execute command
指令如下
su -s /bin/bash -c "command" use_name
例如 MongoDB 数据修复的时候,需要特别注意执行身份的问题。

当 mongodb 的运行账户为 nobody 时。
`su -s /bin/bash -c "mongod --dbpath=/path/to/mongodb/data --repair" nobody`