Creating new user under Ubuntu linux

I create a new user

sudo useradd user_a -d /home/user_a -s /bin/bash
sudo passwd user_a

When I logout as root, I can see new user added "user_a" on the screen.
When I enter incorrect password, it correctly detects. When I enter correct password, it properly validates but the login screen pops up again. Its kind of recursive.

As soon as I mount /home/user_a to some NFS server, then the login works.

1. Why do I have to mount the new users home directory?
2. Instead of NFS server, can I mount it locally so that I can use local machine's disk?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Daniel HelgenbergerCommented:
I assume permissions on the home dir are not correct for user_a. Can you pls. post the output of the following commands, as root:
grep user_a /etc/passwd
ls -l /home|grep user_a
ls -la /home/user_a

Open in new window

A mounted NFS home share could of course fix this. A graphical login will always fail. Please also try running form a terminal:
login user_a

Open in new window

Or, press <ctl><alt><F2> for a getty and try there.
This most commonly works and you get error messages.
perlperlAuthor Commented:
Why does NFS home share fix for graphical login?

$ grep user_a /etc/passwd

$ ls -l /home|grep user_a
drwxrwxrwx  2 root   root    4096 Oct 15 14:05 user_a

$ ls -la /home/user_a
total 8
drwxrwxrwx 2 root root 4096 Oct 15 14:05 .
drwxr-xr-x 6 root root 4096 Oct 15 14:05 ..

/* Without NFS mount for user_a */
$ mount | grep user_a

/* Without mount the other user_b that is working */
$ mount | grep user_b
gvfs-fuse-daemon on /home/user_b/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=user_b)

$ grep user_b /etc/passwd
Daniel HelgenbergerCommented:
Ok, there you have it: for some reason user_a's home dir is owned by Root.
chown -R user_a:user_a /home/user_a
Now, try a graphical login.
NFS shares can fix this if permissions on that share are correct.
Also, are there any other users and might the home folder be mounted in /home by autofs?
Please check this with:
service autofs status

and look into

Also, on Ubuntu use 'adduser' instead of useradd, so /etc/skel gets copied over. This should not hinder a graphical login, but Worth a try.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.