Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am familiar with the useradd and adduser commands but if I create a new user using any of them it can't log into the GUI?! Does this mean I am forced to use the GUI for adding a new user when the system is GUI-based?

share|improve this question
    
just use 'useradd -m' and it will create a homedir for the new one. You should be able to login to that. –  termnml Nov 10 '13 at 19:32
    
What do you mean by "can't log in"? What happens when you try, or what prevents you from trying? Please feel free to edit your question to include more details. –  ændrük Nov 10 '13 at 20:53
add comment

1 Answer 1

up vote 2 down vote accepted

If you had read man useradd you would have seen:

DESCRIPTION
       useradd is a low level utility for adding users. On Debian,
       administrators should usually use adduser(8) instead.

So, to add a user, better to use adduser.

...but if I create a new user using any of them it can't log into the GUI

This is totally false! Creating a new user using adduser, everything what is necessary for a new user to use the GUI is created. Here is an example:

$ sudo adduser test
[sudo] password for xxxx: 
Adding user `test' ...
Adding new group `test' (1001) ...
Adding new user `test' (1001) with group `test' ...
Creating home directory `/home/test' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for test
Enter the new value, or press ENTER for the default
    Full Name []: Test Test
    Room Number []: 7
    Work Phone []: 456123
    Home Phone []: 123456
    Other []: This user is used for tests
Is the information correct? [Y/n] n
Changing the user information for test
Enter the new value, or press ENTER for the default
    Full Name [Test Test]: 
    Room Number [7]: 
    Work Phone [456123]: 
    Home Phone [123456]: 
    Other [This user is used for tests]: 
Is the information correct? [Y/n] y

So, definitely adduser tool is the best way to add a new user using the command line!

See also: man adduser.

share|improve this answer
add comment

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.