Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have created a new user in Linux Mint 12 with these commands:

sudo useradd irene
sudo passwd irene
//Here I entered the password

But if I try to login with this user, the screen goes black for a couple of seconds and then I'm back at the login screen (no error appears). I know the password I enter is correct, because if I enter something else the "wrong password" shows up.

If you need more information or tell me what log files I should check, please tell me.

Here are the results for groups for the two existing users (mine, which is administrator, and the one for my girlfriend):

$ groups osdave
osdave : osdave adm dialout cdrom plugdev lpadmin admin sambashare
$ groups irene
irene : irene

I'd say I have to add irene to a group, but which one? Also, login as irene (in console):

su irene

and moving to home, there is only one osdave directory. Shall I create it myself?

mkdir irene
share|improve this question
    
Maybe you need to add the new user to some groups. You can use groups EXISTING_USER to get the defaults groups. Another thing is to check if the $HOME directory of the new user is accessible. With su you can switch to the new user. –  jofel Mar 10 '12 at 13:27
    
@jofel thx a lot: I've updated my question with some info. Would you be so kind to have another look at it? –  OSdave Mar 10 '12 at 14:43
    
For creating the home directory, see answer from not-a-name. The only groups from your existing groups that you probably want the new user to join are plugdev and cdrom. They allow to mount and access for example USB flash drives. dialout would be needed if the new user should be able to connect via mobile broadband. –  jofel Mar 10 '12 at 21:06

2 Answers 2

up vote 3 down vote accepted

You need to set the user's home directory.

sudo mkdir /home/irene && sudo useradd irene -d /home/irene && sudo chown -R irene:irene /home/irene

But it's always better to use the grpahical UI to add users. If this doesn't work, what version are you using? What DE?

share|improve this answer
    
Also sudo chown -R irene:irene /home/irene is needed so that the new user own his home directory –  jofel Mar 10 '12 at 20:56
    
thx Not a Name, to follow your advice I deleted the previously created user and created again by UI: working now. That's the first time I see the UI option recomended though... –  OSdave Mar 11 '12 at 6:30

(These are generic instructions for investigating this general problem.)

There are two possibilities: either the user can't actually log in (the authentication might succeed, but starting the session fails), or something in the user's profile is causing the user's shell to exit immediately.

To investigate a system-level failure, look at the system logs, typically /var/log/auth.log. Many modern systems use PAM, so you'll see log entries from pam_something mentioning the user name. The PAM configuration is in /etc/pam.conf or /etc/pam.d/name_of_service.

To investigate a user-level failure, try temporarily moving the user's dot files to a different directory. Also, try logging in with su -p rather than on a console, as it looks like the screen is cleared immediately after your login attempt. If it looks like the user's ~/.profile is being executed and exits unduly, add set -x at the top of that file to see a trace of what it does.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.