LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-12-2007, 07:34 AM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 51
adduser without his home directory


hi

I have debian etch stable installed.
howto add a new user without his home directory using command line ?

kind regards
cccc
 
Old 05-12-2007, 08:14 AM   #2
hitest
Guru
 
Registered: Mar 2004
Location: Canada
Distribution: Void, Debian, Slackware
Posts: 7,342

Rep: Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746
Smile

Quote:
Originally Posted by cccc
hi

I have debian etch stable installed.
howto add a new user without his home directory using command line ?

kind regards
cccc
Run the following command as root

#adduser nameofuser

Where name of user is the log-in name that you want for the new user. This will also create a new home directory for the new user.
 
Old 05-12-2007, 08:47 AM   #3
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by hitest
Run the following command as root

#adduser nameofuser

Where name of user is the log-in name that you want for the new user. This will also create a new home directory for the new user.
-M should be used to create without home directoty
Code:
# adduser -M nameofuser
 
Old 05-12-2007, 09:19 AM   #4
hitest
Guru
 
Registered: Mar 2004
Location: Canada
Distribution: Void, Debian, Slackware
Posts: 7,342

Rep: Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746
Question

Quote:
Originally Posted by cccc
-M should be used to create without home directoty
Code:
# adduser -M nameofuser
Just out of curiosity. Why would you want to create a new user without their own home directory?
 
Old 05-12-2007, 10:31 PM   #5
S3xY
LQ Newbie
 
Registered: May 2007
Location: Cairo
Distribution: Debian , FreeBsd
Posts: 19

Rep: Reputation: 0
u can use this options with command [ useradd ]

-r
This flag is used to create a system account. That is, a user with a UID lower than the value of UID_MIN defined in /etc/login.defs and whose password does not expire. Note that useradd will not create a home directory for such an user, regardless of the default setting in /etc/login.defs. You have to specify -m option if you want a home directory for a system account to be created. This is an option added by Red Hat.

-M
The user home directory will not be created, even if the system wide settings from /etc/login.defs is to create home dirs.
 
Old 05-12-2007, 10:54 PM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Hitest, there are plenty of reasons to do this, for example the user apache on redhat has a home directory of /var/www which already exists. Note the difference between having a home directory and creating one when you add a user.


cccc, why didn't you check the man page for this?

Bill
 
Old 05-16-2007, 11:50 PM   #7
TheLateJC
Member
 
Registered: Apr 2007
Location: Sydney
Distribution: Debian. (Formerly Slackware, Gentoo, RHEL, and Suse)
Posts: 80

Rep: Reputation: 15
I don't know why, but on my Etch install - at least in the VM one that I'm using at the mo, useradd does not create a home directory by default, you have to pass the lowercase -m switch to get it to do it.

I'm pretty sure that's the case on my 2 installs at home as well. (I've felt the love for deb in a big way and have it running all over the place .
 
Old 07-24-2009, 05:24 PM   #8
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
create a user without home directory:
Code:
# adduser --no-create-home newuser

Last edited by cccc; 07-24-2009 at 05:25 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
adduser but no shell and no home dir ryedunn Linux - Newbie 7 09-05-2011 09:52 AM
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 02:37 PM
No shift in adduser? not using my previous /home RedNovember Slackware 17 02-08-2006 06:40 AM
I have an nfs mounted /home and 'adduser' fails to create a new user dipukm Linux - Software 4 06-01-2004 06:38 PM
How can I define permissions on a /home/user dir _before_ creating it with adduser skunkburner Linux - General 6 03-18-2004 03:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration