| Forum

How to create a local user in linux when the user already exists in AD/LDAP

I need to create a local user for jboss application. But I get the error users already exist while using the command useradd. But I couldn’t find it in /etc/passwd

$useradd myuser
useradd: user 'myuser' already exists

I think this is because the user already exists in AD.
Is there a way to add the local user as well in this scenario
Please advice.

Yes, you can use the luseradd command

luseradd  myuser

Mostly, this is installed by default. In case you do not find the command by default you can install it using

yum install libuser
apt-get install libuser

You can confirm by checking cat /etc/passwd | grep myuser