diff --git a/src/modules/users/CreateUserJob.cpp b/src/modules/users/CreateUserJob.cpp index 92043045c..c666bd9ad 100644 --- a/src/modules/users/CreateUserJob.cpp +++ b/src/modules/users/CreateUserJob.cpp @@ -153,8 +153,6 @@ CreateUserJob::exec() "-s", "/bin/bash", "-U", - "-G", - defaultGroups, "-c", m_fullName, m_userName } ); @@ -164,6 +162,18 @@ CreateUserJob::exec() tr( "useradd terminated with error code %1." ) .arg( ec ) ); + ec = CalamaresUtils::System::instance()-> + targetEnvCall( { "usermod", + "-aG", + defaultGroups, + m_userName } ); + if ( ec ) + return Calamares::JobResult::error( tr( "Cannot add user %1 to groups: %2." ) + .arg( m_userName ) + .arg( defaultGroups ), + tr( "usermod terminated with error code %1." ) + .arg( ec ) ); + ec = CalamaresUtils::System::instance()-> targetEnvCall( { "chown", "-R",