notes icon indicating copy to clipboard operation
notes copied to clipboard

linux 下以 nologin 账户身份运行 or linux nologin user execute command

Open lanlin opened this issue 7 years ago • 0 comments

指令如下

su -s /bin/bash -c "command" use_name

例如 MongoDB 数据修复的时候,需要特别注意执行身份的问题。

image

当 mongodb 的运行账户为 nobody 时。

`su -s /bin/bash -c "mongod --dbpath=/path/to/mongodb/data --repair" nobody`

lanlin avatar Mar 06 '18 08:03 lanlin