Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
useradd -d and -b
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
dman777
Veteran
Veteran


Joined: 10 Jan 2007
Posts: 1004

PostPosted: Mon Nov 09, 2009 11:16 pm    Post subject: useradd -d and -b Reply with quote

I am having trouble understanding exactly what useradd -d and -b and other than the man page I haven't seen much about these options. Can anyone give me examples on how they would be used?
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Tue Nov 10, 2009 12:22 am    Post subject: Reply with quote

The man page seems perfectly clear to me, but I'll try put it in my own words.

-b, or --base-dir, is by default "/home".
If you wanted a user's home directory to be created elsewhere, this is what you'd use to change it.
For example, `useradd -g users -m -b /export hopeless` would create the hopeless account with the home directory "/export/hopeless" rather than "/home/hopeless".

-d just enables you to have the home directory of a new user set to something other than that users login name, for example with `useradd -g users -m -d foo hopeless`, the home directory of new user hopeless would be "/home/foo" rather than "/home/hopeless".

Basically, they just allow you to manipulate the sixth entry of the /etc/passwd file, enabling you to have a user's home directory in a non-standard location if you so desire.

HTH.

On the other hand, if you already got the above and were just wondering why or when such options would be used, in most cases the wouldn't, unless you think you have use for it yourself don't worry about it.
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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