FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 01-30-2011, 08:07 PM
Soo-Hyun Choi
 
Default How to relocate $HOME directory

Hi there,

As you know, $HOME is generally located at "/home/$username" by default.

I would like to re-locate all users' $HOME directories to something like
"/export/home/$username" without having a hassle/trouble.

Initially, I've thought of just copying them to the new directory (under
/export/home/xxx), but guessed it might trouble for the normal use (I'm
pretty new to CentOS, although many experiences with Debian/Ubuntu).

Is there any good tricks (or caveats) when moving users' home directory
cleanly with CentOS? (I'm with CentOS 5.5 x86_64)

Cheers,
Soo-Hyun

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-30-2011, 08:38 PM
Gene Brandt
 
Default How to relocate $HOME directory

This is not a CentOs issue or problem. This plain Jane UNIX. $HOME can be anything you want or need it to be. Copy the user's home directory to where you want and make the appropriate changes in the passwd file or automount maps.






--

Thanks,



Gene Brandt SCSA

8625 Carriage Road

River Ridge, LA 70123


home 504-737-4295

cell 504-452-3250

Family Web Page* |* My Web Page* | LinkedIn* | Facebook* |* Resumebucket







On Mon, 2011-01-31 at 06:07 +0900, Soo-Hyun Choi wrote:


Hi there,

As you know, $HOME is generally located at "/home/$username" by default.

I would like to re-locate all users' $HOME directories to something like
"/export/home/$username" without having a hassle/trouble.

Initially, I've thought of just copying them to the new directory (under
/export/home/xxx), but guessed it might trouble for the normal use (I'm
pretty new to CentOS, although many experiences with Debian/Ubuntu).

Is there any good tricks (or caveats) when moving users' home directory
cleanly with CentOS? (I'm with CentOS 5.5 x86_64)

Cheers,
Soo-Hyun

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos




_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-30-2011, 08:58 PM
Soo-Hyun Choi
 
Default How to relocate $HOME directory

Hi,

> This is not a CentOs issue or problem. This plain Jane UNIX. $HOME can
> be anything you want or need it to be. Copy the user's home directory to
> where you want and make the appropriate changes in the passwd file or
> automount maps.
>

Well, yes and no. In case of Debian/Ubuntu, we need to modify apparmor
settings (e.g., by changing "etc/apparmor.d/tunables/home" information)
to get it right apart from just copying them and changing passwd file.

I wondered if CentOS has such an issue when relocating $HOME directories.

Cheers,
Soo-Hyun

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-31-2011, 04:15 AM
Keith Keller
 
Default How to relocate $HOME directory

On Mon, Jan 31, 2011 at 06:58:36AM +0900, Soo-Hyun Choi wrote:
>
> Well, yes and no. In case of Debian/Ubuntu, we need to modify apparmor
> settings (e.g., by changing "etc/apparmor.d/tunables/home" information)
> to get it right apart from just copying them and changing passwd file.
>
> I wondered if CentOS has such an issue when relocating $HOME directories.

Not that I'm aware. But you could always relocate the home directories
and then create appropriate symlink(s).

For example, if you're relocating everyone, you can move the users'
directories, then remove /home and create /home as a symlink to the new
top-level home directory (/export/blah). Or, if your users will be in
various different places, you can keep /home and create a symlink for
each user (/home/user1 -> /export1/user1 ; /home/user2 ->
/export3/user2).

There are probably many other ways to deal with this; AFAIK CentOS
shouldn't have any difficulties with any of these situations.

--keith


--
kkeller@wombat.san-francisco.ca.us

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-31-2011, 04:18 AM
Rudi Ahlers
 
Default How to relocate $HOME directory

On Sun, Jan 30, 2011 at 11:07 PM, Soo-Hyun Choi <s.choi@terabit.org.uk> wrote:
> Hi there,
>
> As you know, $HOME is generally located at "/home/$username" by default.
>
> I would like to re-locate all users' $HOME directories to something like
> "/export/home/$username" without having a hassle/trouble.
>
> Initially, I've thought of just copying them to the new directory (under
> /export/home/xxx), but guessed it might trouble for the normal use (I'm
> pretty new to CentOS, although many experiences with Debian/Ubuntu).
>
> Is there any good tricks (or caveats) when moving users' home directory
> cleanly with CentOS? (I'm with CentOS 5.5 x86_64)
>
> Cheers,
> Soo-Hyun
>
> _______________________________________________



The easiest way would be to move (or copy) everything in /home to
/export/home, and then remount /home on /export/home in your fstab.

Before you remount it, you may want to rename it to say /oldhome or
/home2 or something like that, and then if everything works fine then
you simply delete it


--
Kind Regards
Rudi Ahlers
SoftDux

Website: http://www.SoftDux.com
Technical Blog: http://Blog.SoftDux.com
Office: 087 805 9573
Cell: 082 554 7532
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-31-2011, 04:55 AM
Nico Kadel-Garcia
 
Default How to relocate $HOME directory

On Mon, Jan 31, 2011 at 12:18 AM, Rudi Ahlers <Rudi@softdux.com> wrote:
> On Sun, Jan 30, 2011 at 11:07 PM, Soo-Hyun Choi <s.choi@terabit.org.uk> wrote:
>> Hi there,
>>
>> As you know, $HOME is generally located at "/home/$username" by default.
>>
>> I would like to re-locate all users' $HOME directories to something like
>> "/export/home/$username" without having a hassle/trouble.
>>
>> Initially, I've thought of just copying them to the new directory (under
>> /export/home/xxx), but guessed it might trouble for the normal use (I'm
>> pretty new to CentOS, although many experiences with Debian/Ubuntu).
>>
>> Is there any good tricks (or caveats) when moving users' home directory
>> cleanly with CentOS? (I'm with CentOS 5.5 x86_64)
>>
>> Cheers,
>> Soo-Hyun
>>
>> _______________________________________________
>
>
>
> The easiest way would be to move (or copy) everything in /home to
> /export/home, and then remount /home on /export/home in your fstab.
>
> Before you remount it, you may want to rename it to say /oldhome or
> /home2 or something like that, and then if everything works fine then
> you simply delete it

This tends to break symlinks and hard-coded script locations. In
particular, Samba and Apache make some assumptions about where home
directories live that you might want to resolve if you enable homedir
access for or public_html access for those tools.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-31-2011, 05:22 AM
Tom H
 
Default How to relocate $HOME directory

On Mon, Jan 31, 2011 at 12:18 AM, Rudi Ahlers <Rudi@softdux.com> wrote:
> On Sun, Jan 30, 2011 at 11:07 PM, Soo-Hyun Choi <s.choi@terabit.org.uk> wrote:
>>
>> As you know, $HOME is generally located at "/home/$username" by default.
>>
>> I would like to re-locate all users' $HOME directories to something like
>> "/export/home/$username" without having a hassle/trouble.
>>
>> Initially, I've thought of just copying them to the new directory (under
>> /export/home/xxx), but guessed it might trouble for the normal use (I'm
>> pretty new to CentOS, although many experiences with Debian/Ubuntu).
>>
>> Is there any good tricks (or caveats) when moving users' home directory
>> cleanly with CentOS? (I'm with CentOS 5.5 x86_64)
>
> The easiest way would be to move (or copy) everything in /home to
> /export/home, and then remount /home on /export/home in your fstab.
>
> Before you remount it, you may want to rename it to say /oldhome or
> /home2 or something like that, and then if everything works fine then
> you simply delete it

If you're changing the root of /home to another mount point or
directory, say "/export/home", you'll also have to use semanage to set
its selinux context to "home_root_t", etc.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-31-2011, 07:34 AM
Kenneth Porter
 
Default How to relocate $HOME directory

--On Monday, January 31, 2011 12:55 AM -0500 Nico Kadel-Garcia
<nkadel@gmail.com> wrote:

> This tends to break symlinks and hard-coded script locations. In
> particular, Samba and Apache make some assumptions about where home
> directories live that you might want to resolve if you enable homedir
> access for or public_html access for those tools.

I'd be surprised if such well-written packages didn't simply use the value
from /etc/passwd (acquired by the appropriate API, such as getpwent(3)).
Remember also that Samba and Apache are written to be used on other than
Linux, and other OS's might not keep their home directories in the same
place.

As Tom H points out, the big issue is to set the selinux attributes of home
directories not in the more common location.


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-31-2011, 07:43 AM
John R Pierce
 
Default How to relocate $HOME directory

On 01/31/11 12:34 AM, Kenneth Porter wrote:
> --On Monday, January 31, 2011 12:55 AM -0500 Nico Kadel-Garcia
> <nkadel@gmail.com> wrote:
>
>> This tends to break symlinks and hard-coded script locations. In
>> particular, Samba and Apache make some assumptions about where home
>> directories live that you might want to resolve if you enable homedir
>> access for or public_html access for those tools.
> I'd be surprised if such well-written packages didn't simply use the value
> from /etc/passwd (acquired by the appropriate API, such as getpwent(3)).
> Remember also that Samba and Apache are written to be used on other than
> Linux, and other OS's might not keep their home directories in the same
> place.
>

apache itself has no clue and doesn't look at /etc/passwd or any other
such. instead, /home/*/public_html is specified in the httpd.conf
files, if that feature is enabled.


> As Tom H points out, the big issue is to set the selinux attributes of home
> directories not in the more common location.

yeah,t hat will bite you


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-31-2011, 07:49 AM
Rudi Ahlers
 
Default How to relocate $HOME directory

On Mon, Jan 31, 2011 at 8:22 AM, Tom H <tomh0665@gmail.com> wrote:
> On Mon, Jan 31, 2011 at 12:18 AM, Rudi Ahlers <Rudi@softdux.com> wrote:
>> On Sun, Jan 30, 2011 at 11:07 PM, Soo-Hyun Choi <s.choi@terabit.org.uk> wrote:
>>>
>>> As you know, $HOME is generally located at "/home/$username" by default.
>>>
>>> I would like to re-locate all users' $HOME directories to something like
>>> "/export/home/$username" without having a hassle/trouble.
>>>
>>> Initially, I've thought of just copying them to the new directory (under
>>> /export/home/xxx), but guessed it might trouble for the normal use (I'm
>>> pretty new to CentOS, although many experiences with Debian/Ubuntu).
>>>
>>> Is there any good tricks (or caveats) when moving users' home directory
>>> cleanly with CentOS? (I'm with CentOS 5.5 x86_64)
>>
>> The easiest way would be to move (or copy) everything in /home to
>> /export/home, and then remount /home on /export/home in your fstab.
>>
>> Before you remount it, you may want to rename it to say /oldhome or
>> /home2 or something like that, and then if everything works fine then
>> you simply delete it
>
> If you're changing the root of /home to another mount point or
> directory, say "/export/home", you'll also have to use semanage to set
> its selinux context to "home_root_t", etc.
> _______________________________________________



I generally do this on systems without website stored in the home
folders, since website files are normally stored in /var/www/html
folder by default.

So, in this case you just need to update the httpd.conf file and tell
it where the new home folder resides, IF you actually store website
files in the /home folder.

--
Kind Regards
Rudi Ahlers
SoftDux

Website: http://www.SoftDux.com
Technical Blog: http://Blog.SoftDux.com
Office: 087 805 9573
Cell: 082 554 7532
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 03:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org