LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-04-2013, 07:18 PM   #1
j.curtis
LQ Newbie
 
Registered: Oct 2013
Posts: 17

Rep: Reputation: 10
Breaking old traditions of not using the home directory


Hi

In linux traditions the home directory has always been the home for users. I want to break that tradition and use another location with proper permissions and modifying certain files.

I am planning to test this idea in a VM and not on my main desktop. Has anyone tried this before and second is it wise to do this. For example, there may be system environments varibles and system scripts that reference the home directory.

Do you think this is wise to do
 
Old 11-04-2013, 07:23 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

it's actually fairly common on large multiuser *nix systems for the users home directories to be somewhere other than /home/. Go for it.

Evo2.
 
Old 11-04-2013, 07:28 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
Not sure it is unwise but I wouldn't do it. There isn't any great need to reinvent this wheel.

It is common to put some /home at some place even if on a remote system and of course /root usually is in it's own.
 
Old 11-04-2013, 07:29 PM   #4
j.curtis
LQ Newbie
 
Registered: Oct 2013
Posts: 17

Original Poster
Rep: Reputation: 10
Thanks evo2, I will go for it. And if it failes, only the distro in the VM will be affected.
 
Old 11-04-2013, 07:34 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by j.curtis View Post
Thanks evo2, I will go for it. And if it failes, only the distro in the VM will be affected.
If for some reason you have problems with this setup, I'd be interested to know what those problems are. In this case please also let us know how you set the home directory location. (eg set DHOME in adduser.conf and then created the user, or editied /etc/password and manually moved existing users home directory etc).

Cheers,

Evo2.
 
Old 11-04-2013, 08:34 PM   #6
j.curtis
LQ Newbie
 
Registered: Oct 2013
Posts: 17

Original Poster
Rep: Reputation: 10
I think I am having second thoughts of doing this. There will be shell scripts and configuration files in the system that deal with user accounts and the home directory. I know a couple of them but there are others that I may not know. I would have to find those files and modify any reference to the home directory and/or user accounts.

I think jefro may have a point of not reinventing the wheel.

If I were a LFS ( Linux From Scratch ) user, I would probably know all scripts and config files dealing with home directories and user accounts.

But who knows, maybe on a slow boring day, I may try it and post the outcome.

Thanks again Evo2 and jefro for the inputs
 
Old 11-04-2013, 08:41 PM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by j.curtis View Post
I think I am having second thoughts of doing this. There will be shell scripts and configuration files in the system that deal with user accounts and the home directory.
Yes and they know where the home directory is because it it defined in /etc/password, _not_ because of the convention that it is usually /home/username/. Scripts and programs have access to this via either ~ or $HOME. Any script that assumes /home/$USER is the home directory should be immediately treated with suspicion: what else did the author not understand about the system the script is running on?

Quote:
I know a couple of them but there are others that I may not know. I would have to find those files and modify any reference to the home directory and/or user accounts.
This should not be necessary. What configuration files and scripts are you concerned about?

Evo2.
 
Old 11-04-2013, 08:49 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
I'm just curious of the reasoning. Not judging, just curious.

I typically have two possible locations for user home directories on my systems. Primary users are located in /home, remote scp-only users (those ones where basic ftp is not sufficient for security, yet I don't want them to have access to the rest of the filesystem) are located in /usr/local/chroot/ in an rssh-based chroot jail.

Setting up a new user in either category is trivially easy, so I'm having trouble seeing why:
1) Setting up a user with a home directory outside of /home an issue to begin with
2) It's a requirement...what's wrong with /home/ for your application?
 
Old 11-04-2013, 08:52 PM   #9
j.curtis
LQ Newbie
 
Registered: Oct 2013
Posts: 17

Original Poster
Rep: Reputation: 10
/etc/passwd
/etc/fstab
/etc/default/useradd

I did find this article online and it seems doable.
http://www.cyberciti.biz/faq/howto-c...ome-directory/

So I am going to try it in a VM and see if any applications would be affected by changing the home directory.
 
Old 11-04-2013, 09:00 PM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by j.curtis View Post
/etc/passwd
Yes, I mentioned this earlier, it is what *defines* the home directory for each user.
Quote:
/etc/fstab
This is in no way specific to /home being the location of the users home directories, just shows how to mount partitions.
Quote:
/etc/default/useradd
This can be used for telling useradd to where to put new users home directories (similar to /etc/adduser.conf that I mentioned earlier) if it is not specified on the command line.

Evo2.
 
Old 11-04-2013, 09:12 PM   #11
j.curtis
LQ Newbie
 
Registered: Oct 2013
Posts: 17

Original Poster
Rep: Reputation: 10
@ Evo2

I never done this before and assumed that these files were enough to to what I wanted plus changing permissions on the new location.
Quote:
Originally Posted by suicidaleggroll View Post
I'm just curious of the reasoning. Not judging, just curious.

I typically have two possible locations for user home directories on my systems. Primary users are located in /home, remote scp-only users (those ones where basic ftp is not sufficient for security, yet I don't want them to have access to the rest of the filesystem) are located in /usr/local/chroot/ in an rssh-based chroot jail.

Setting up a new user in either category is trivially easy, so I'm having trouble seeing why:
1) Setting up a user with a home directory outside of /home an issue to begin with
2) It's a requirement...what's wrong with /home/ for your application?
It's mainly an experimental issue. Some linux users like me. like to try different things or tinker with the system. All tests and tinkering is done in a VM of course.
 
Old 11-04-2013, 09:20 PM   #12
j.curtis
LQ Newbie
 
Registered: Oct 2013
Posts: 17

Original Poster
Rep: Reputation: 10
Good Night All
 
Old 11-05-2013, 04:05 PM   #13
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
It is well worth a try. Like I said, it is not unwise, just not something I'd do. You are encouraged to try it and hopefully report back. It may take months for issues to show up and many installs of apps too.

I think home being on some partition has saved more than a few admin's and maybe sunk a few. Usually just makes it easy to backup or update OS.

Last edited by jefro; 11-05-2013 at 04:07 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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
User does int getting home directory in root home in ubuntu 10.04 lucid lynx sunrised24 Linux - Server 2 03-07-2012 09:21 AM
"Home directory already exists. Please enter another home directory path." Daravon Ubuntu 2 02-15-2009 10:26 PM
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 04:02 PM
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 02:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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