Creating new user under Ubuntu linux

Posted on 2013-10-15
Medium Priority
Last Modified: 2013-11-01
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?
Question by:perlperl
  • 2
LVL 13

Expert Comment

by:Daniel Helgenberger
ID: 39574468
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.

Author Comment

ID: 39574568
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
LVL 13

Accepted Solution

Daniel Helgenberger earned 2000 total points
ID: 39574650
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.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question