Re: sym link question...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 9 Mar 2005 16:39:59 -0800, bruce <bedouglas@xxxxxxxxxxxxx> wrote:
> is it possible to create a symlink that would allow '/' to point to
> /usr/root.

No.  To create a symlink, like any kind of filesystem entry, the name must
not already exist.  And "/" will always exist.

The closest thing to what you want is the chroot command (or
equivalent system call for programmers).  Every process has one
directory that it considers to be the root directory, e.g., "/".  By
default all processes share the same real directory as their root.
But the chroot command/system call allows a process to redefine
which directory it considers to be it's "/".

This technique is most commonly used to create what's called
a "chroot jail", for security purposes.  Because once a process
has changed it's idea of "/" to be some subdirectory it is forever
restricted to just that particular subdirectory.

It's also used for other purposes sometimes too, most usually
when you're using say the rescue CD where you want to change
from referencing the temporary memory-resident rescue filesystem
to the on-disk filesystem.

It's more involved to use chroot than just a symlink.  Because
you have to make sure that all the necessary files are present
in your new "/"; including things like some commands like
/bin/ls, or rudementary devices like /dev/null.
-- 
Deron Meranda


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux