chroot file permissions
I have some old legacy programs compiled under Centos 6.5 which are no longer supported by the current Centos distros. I therefore made a copy of my old Centos 6 installation under a new directory (say, centos6.5) and copied all the libraries, system binaries and /etc to that directory. By doing
sudo chroot centos6.5 bash
I can run all the old programs without problem. Also, when I do chroot, I am automatically logged in as root. Since I've copied over the passwd* files in /etc, I can su to myself - again, no problem. However, when I create a home directory in centos6.5/home with the same username, the ownership and file permissions of the home directory are different once I log in using chroot. To have a home directory with the same ownership and permissions I have to create it after I log in with chroot. But this means any other personal files I then copy to centos6.5/home/<my username> have the same problems with ownership.
I don't understand why, if all the /etc/passwd* files are the same under my real system and my "chroot" system, this problem occurs. For example I have two different machines with the same passwd files and I can transfer files between the two and preserve all the ownership and permissions.
Any help would be much appreciated.
Terence
|