Breaking old traditions of not using the home directory
Linux - GeneralThis 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.
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.
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.
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).
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.
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?
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?
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.