Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Using linux I need create a new user but personalize the path of own home in /etc/passwd. For now I using:

adduser test0 --shell /bin/nologin --disabled-password  --no-create-home --quiet --force-badname --gecos ""

But in /etc/passwd I've

test0:x:1004:1005:,,,:/home/test0:/bin/nologin

I need somethinkg like this:

test0:x:1004:1005:,,,:/home/personal/test0:/bin/nologin
share|improve this question
1  
Why don't you just use --home=...? I couldn't test if it is interfering with -no-create-home, but accroding to man page: --home DIR Use DIR as the user's home directory, rather than the default specified by the configuration file. If the directory does not exist, it is created and skeleton files are copied. –  mpy Jul 8 '13 at 11:27
    
Correct: --home. thanks! –  Pol Hallen Jul 8 '13 at 11:31

1 Answer 1

You can add the parameter --home HOME_DIR to define the home directory.

So the command line must be

adduser test0 --shell /bin/nologin --disabled-password --home /home/personal/test0 --no-create-home --quiet --force-badname --gecos ""
share|improve this answer
    
Thanks! On debian linux there's --home (and not --home-dir). –  Pol Hallen Jul 8 '13 at 11:31
    
Changed the answer accordingly. Had only a fedora system and there it is --home-dir. –  Uwe Plonus Jul 8 '13 at 11:33
    
@PolHallen, that's because adduser is a non-standard higher-level wrapper over the useradd tool (which is sort of standardized). Also please note there's no such thing as "debian linux" -- there's Debian (an OS, as well as, say, Fedora is), and there's Linux -- an OS kernel. –  kostix Jul 8 '13 at 12:21

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.