2

What I would like to create if I had root access would be a symlink from some file or folder in the /etc to another file or folder in the /etc. However, I do not have root access.

Is there any way to "fool" Linux, such that it would think (for the current user only) that there is a symlink?

  • What are you actually trying to achieve, or is fooling Linux your only objective? If there is a particular program that needs to read the data pointed to by the link, you should tell us what it is. – Anthon Feb 20 '15 at 10:28
  • I've already solved this issue in my program, this question comes from my curiosity. – syntagma Feb 20 '15 at 10:54
  • The whole point of having a security system is so that you can't "fool" it into doing things that you don't have permission to do. – hymie Feb 20 '15 at 14:34
  • @hymie I didn't say I want to have a security system. – syntagma Feb 20 '15 at 14:40
  • Linux has a security system. You have no choice but to work within it. – hymie Feb 20 '15 at 15:31
1

The OS has permissions on the directories and if they don't permit a user to create anything in /etc it would be a security hole if some other mechanism would have the OS open other files than it thinks it is doing. (If the user has the permissions there is no need to fool the OS, then she can just change the files).

That permissions on /etc are normally as restrictive as they are is necessary in order e.g. not to have a user change provide alternative private keys for sshd (by "fooling" the os not to use the ones from /etc/ssh, and other system information for which integrity is important.

You can mount other filesystems over /etc, and some of those can be handled in userspace, and thus possible by normal users without the OS noticing (in being notified of the change). But you still need root access to do the intial mount, so I would hardly call that fooling the OS.

You indicate that you solved this at your program and that is the level at which you can do the fooling, but of course that won't affect the OS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.