LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   useradd defaults (https://www.linuxquestions.org/questions/linux-newbie-8/useradd-defaults-635262/)

pretruder 04-14-2008 09:48 AM

useradd defaults
 
How do I make the defaults set a new user to the /home directory?
When i add a user now it places the user at / at login, but i want it to create a directory in /home and place them there at log in...
I have successfully installed a windows-slackware dualboot, and so far I havn't had any problems.I even got my linux connected to the internet with success.However, I am a brandnew linux user, so I don't really know that much but learn fast. A friend referred me to this forum with great recomendation. I'm brand new so please be patient. I'm sure I'll be back with many questions :P

brianL 04-14-2008 10:30 AM

I use adduser instead of useradd: adduser name, then it asks a few questions - such as: /home/name -most of which it's OK to accept the defaults.

onebuck 04-14-2008 11:28 AM

Hi,

Welcome to LQ & Slackware!

As stated you should use the 'adduser' to create new accounts. Be sure to add the new user to the necessary groups;

Code:

floppy audio video cdrom plugdev
12.0 and HAL - READ THIS! is a thread you should read.

prad77 04-14-2008 01:29 PM

Specifying options accordingly will create the required home dir .Take care of -b, -d , -m options while defining home dirs.

-b, --base-dir BASE_DIR
The default base directory for the system if -d dir is not specified. BASE_DIR is concatenated with the account name to define the home directory. If the -m option is not used, BASE_DIR must exist.
-d, --home HOME_DIR
The new user will be created using HOME_DIR as the value for the user's login directory. The default is to append the LOGIN name to BASE_DIR and use that as the login directory name. The directory HOME_DIR does not have to exist but will not be created if it is missing.

useradd -d /home/james jim

Gentoo

pretruder 04-14-2008 03:08 PM

Thanks alot guys, I got it! Also, thankyou for the warm welcome.
I have been waiting so long for this installation lol.
I was on dial-up and just recently got cable and was finally able to download it and install it. I'm proud to say my first dual boot installation went very well (although slackware has done a remarkable job of making it easy in my opinion)
Linux 4 life!

PS-Thanx 4 the links onebuck. They were very helpful.

gilead 04-14-2008 08:32 PM

If you do use useradd at some point (in scripts, etc.) you can put default settings in /etc/default/useradd so that you can keep the command line simple.


All times are GMT -5. The time now is 12:38 AM.