From 82ffdbfb303671717b5b1ee7871ba4153ca3da51 Mon Sep 17 00:00:00 2001 From: zer0e <63488636+zero-element@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:30:23 +0800 Subject: [PATCH] fix: create linux user with home dir (#15670) --- .../java/org/apache/dolphinscheduler/common/utils/OSUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java index 243161df88..beca53c3fd 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java +++ b/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); }