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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-04-2013, 07:18 PM
|
#1
|
LQ Newbie
Registered: Oct 2013
Posts: 17
Rep:
|
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
|
|
|
11-04-2013, 07:23 PM
|
#2
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
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.
|
|
|
11-04-2013, 07:28 PM
|
#3
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
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.
|
|
|
11-04-2013, 07:29 PM
|
#4
|
LQ Newbie
Registered: Oct 2013
Posts: 17
Original Poster
Rep:
|
Thanks evo2, I will go for it. And if it failes, only the distro in the VM will be affected.
|
|
|
11-04-2013, 07:34 PM
|
#5
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
Hi,
Quote:
Originally Posted by j.curtis
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.
|
|
|
11-04-2013, 08:34 PM
|
#6
|
LQ Newbie
Registered: Oct 2013
Posts: 17
Original Poster
Rep:
|
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
|
|
|
11-04-2013, 08:41 PM
|
#7
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
Hi,
Quote:
Originally Posted by j.curtis
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.
|
|
|
11-04-2013, 08:49 PM
|
#8
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
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?
|
|
|
11-04-2013, 08:52 PM
|
#9
|
LQ Newbie
Registered: Oct 2013
Posts: 17
Original Poster
Rep:
|
/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.
|
|
|
11-04-2013, 09:00 PM
|
#10
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
Hi,
Quote:
Originally Posted by j.curtis
/etc/passwd
|
Yes, I mentioned this earlier, it is what *defines* the home directory for each user.
This is in no way specific to /home being the location of the users home directories, just shows how to mount partitions.
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.
|
|
|
11-04-2013, 09:12 PM
|
#11
|
LQ Newbie
Registered: Oct 2013
Posts: 17
Original Poster
Rep:
|
@ 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
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. 
|
|
|
11-04-2013, 09:20 PM
|
#12
|
LQ Newbie
Registered: Oct 2013
Posts: 17
Original Poster
Rep:
|
Good Night All 
|
|
|
11-05-2013, 04:05 PM
|
#13
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
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.
|
|
|
All times are GMT -5. The time now is 11:02 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|