Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
When I create a new user why is his home dir not created?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
HGeneAnthony
n00b
n00b


Joined: 02 Oct 2004
Posts: 14

PostPosted: Tue Nov 01, 2005 3:29 pm    Post subject: When I create a new user why is his home dir not created? Reply with quote

When I use adduser [username] it does not create the user's home directory. In fact, even if I specify -d /home/[username] it's not created. Even if I create it I have to change ownership and I still have issues. How do you create the home directory under Gentoo? This is on the same partition as the root partition and it's using a reiserfs.
Back to top
View user's profile Send private message
chrbecke
Guru
Guru


Joined: 12 Jul 2004
Posts: 598
Location: Berlin - Germany

PostPosted: Tue Nov 01, 2005 3:33 pm    Post subject: Reply with quote

Try the following:
Code:
useradd -m -d /home/<username> <username>
"-d" only records the home dir in /etc/passwd. "-m" tells uderadd to create it if it doesn't exist.
Back to top
View user's profile Send private message
TheWitePony
Apprentice
Apprentice


Joined: 04 Feb 2004
Posts: 211

PostPosted: Tue Nov 01, 2005 3:37 pm    Post subject: Reply with quote

Use the -m option to create the user directory. From man useradd:
Code:

-m     The  user's home directory will be created if it does not exist. The files contained in skeleton_dir will be copied to the home directory if the -k option is used, otherwise the files contained in /etc/skel will  be  used  instead. Any directories contained in skeleton_dir or /etc/skel will be created in the user's home directory as well. The -k option is only valid in conjunction with the -m option. The default is to not create the directory and to not  copy any files.
Back to top
View user's profile Send private message
davascript
l33t
l33t


Joined: 07 Apr 2004
Posts: 618
Location: Pennsylvania

PostPosted: Tue Nov 01, 2005 4:38 pm    Post subject: Reply with quote

Try this
Code:
useradd <username> -m -G comma,seperated,list,of,groups -s /bin/bash


the -G tells which groups the user bleongs to such as users,wheel,audio,cdrw,games and such
and the -s specifies which shell to use
Back to top
View user's profile Send private message
Monkeh
Veteran
Veteran


Joined: 06 Aug 2005
Posts: 1656
Location: England

PostPosted: Tue Nov 01, 2005 5:24 pm    Post subject: Reply with quote

Code:
emerge superadduser


It's a script from Slackware (which I believe nicked it from one of the BSDs) for adding users. Rather handy.
Back to top
View user's profile Send private message
HGeneAnthony
n00b
n00b


Joined: 02 Oct 2004
Posts: 14

PostPosted: Tue Nov 01, 2005 9:34 pm    Post subject: Reply Reply with quote

Thank you for the help. I've been using Linux for 4 years and this is the first distro I've seen that didn't create a home directory with the useradd command by default. I do love Gentoo though. In my opinion, the best of the Linux distros. I'll use the m argument. I already do use -g [other groups] though. I remember when I first got Linux you needed to switch groups before you got the rights of that group. Even if you belonged to it you had to switch it to your primary to get the rights of the group. Was this fixed yet?
Back to top
View user's profile Send private message
ohyeah1942
n00b
n00b


Joined: 21 Mar 2004
Posts: 68

PostPosted: Tue Nov 01, 2005 11:15 pm    Post subject: Reply with quote

that is not necessary under gentoo.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 17862

PostPosted: Mon Nov 07, 2005 7:11 pm    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic-t-49783-highlight-useradd.html
_________________

Believing I had supernatural powers I slammed into a brick wall.
I said hey, is this my problem? Is this my fault?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum