useradd - shell missing features after adding user

Hi, I need to create a user from a bash script so i have to use useradd. The problem is that when i create a user with:

useradd -d /home/sample -m sample

after i login with that user I have no history in bash, path do not appears, i can't use arrows and so on. When I use adduser everything is fine but what I'm missing here ? What parameters do i have to use with useradd so when I login with that user bash has full features.

Thank you.

try usermod -s /bin/bash <username> if the shell is not bash, for some reason. Alternately check to make sure the contents of /etc/skel were copied to the user's home.

useradd does not give the user any more parameters than those you create, so the way you're using it, it won't asign bash as the default shell.

I'd use this:
useradd -d /home/user -s /bin/bash -G group -m user

Remove the -g in case you don't want him to be in a specific group.
I'd try adding a -p password with a password that might be maybe the same user name

Good luck

if you use the -G group that will be a secondary group. If you want them to be in default groups, then you can leave that off. Otherwise, use -G for groups you don't want to include their primary GID. -g is used for their primary GID/group.

useradd -d /home/user -m -s /bin/bash -c "Name&Surname" user

this will create new user

then
passwd user --> enter new password

then transfer owneship to new user

chown -R user /home/user

ownership should not need transferring when made with useradd especially if the -m switch is used.