LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-25-2017, 02:13 AM   #1
chenco
LQ Newbie
 
Registered: Sep 2017
Posts: 2

Rep: Reputation: Disabled
Change Default home Directory Debian 9 Strech


Hello,
I've edited the file
/etc/default/useradd

Changed the /home to /home3

but when i add new users , it still creates in /home

Is there anything else that i have to change?


Thank you
 
Old 09-25-2017, 02:40 AM   #2
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
Welcome to LQ!!! Can you verify with: useradd -D | grep HOME
Also: ls -ld /home3

Last edited by !!!; 09-25-2017 at 02:43 AM.
 
Old 09-25-2017, 05:19 AM   #3
chenco
LQ Newbie
 
Registered: Sep 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
hello, the command replays :
useradd -D | grep HOME
HOME=/home3


but when i add a new user it still goes to /home
 
Old 09-26-2017, 03:16 AM   #4
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
I agree with you that it 'should work'!!!
There must be something non-obvious going on.
That's why I asked about the /home3 dir.
(for example: strange fs/mount or 'bad' permissions)

A better wild-guess: aliased: -b /home. Try: \useradd -m newuser
Or -m omitted. Both before&after useradd: tail -1 /etc/passwd ; ls /home*

**Post output of: type useradd ; grep HOME /etc/login.defs
(research the effects of whatever output you get)

IF you manually edit /etc/passwd,
to change the new user to home3 and setup the dir and ownership, does it work?
(meaning the newuser accessing in home3, not meaning the 'still-broken' useradd)

An extreme debug tool is: strace -f -o filename useradd newuser
Then you'd dig thru the -ofile, to check relevant dir/files accessed.

Let's check /home3 is 'all ok'. Let us know. ls -la /home3 ; df /home*

Last edited by !!!; 09-26-2017 at 04:55 AM.
 
  


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
Change default home directory for new users packets Linux - Newbie 4 05-30-2016 10:34 PM
[SOLVED] Change Default Home Directory Location NotAComputerGuy Linux - Newbie 4 07-17-2013 06:22 AM
[SOLVED] Change Default Home Directory for Ldap User sunveer Linux - Newbie 1 08-14-2012 11:27 PM
change default vsftp anonymous accout directory /var/ftp to other directory? hocheetiong Linux - Newbie 2 01-24-2010 06:33 PM
Change Default Home Directory with LDAP and Automount greslore Linux - General 3 06-23-2009 03:32 PM

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

All times are GMT -5. The time now is 04:19 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