Browse Source

fix: create linux user with home dir (#15670)

dev_wenjun_refactorMaster
zer0e 9 months ago committed by GitHub
parent
commit
82ffdbfb30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java

2
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java

@ -229,7 +229,7 @@ public class OSUtils {
*/
private static void createLinuxUser(String userName, String userGroup) throws IOException {
log.info("create linux os user: {}", userName);
String cmd = String.format("sudo useradd -g %s %s", userGroup, userName);
String cmd = String.format("sudo useradd -m -g %s %s", userGroup, userName);
log.info("execute cmd: {}", cmd);
exeCmd(cmd);
}

Loading…
Cancel
Save