Skip to content

Commit

Permalink
fix: create linux user with home dir
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-element committed Mar 5, 2024
1 parent 04a6b0d commit 8fe20d9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public static boolean createUser(String userName) {
*/
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);
}
Expand Down

0 comments on commit 8fe20d9

Please sign in to comment.