LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How do I capture a file-->open command and restrict the path of access (https://www.linuxquestions.org/questions/programming-9/how-do-i-capture-a-file-open-command-and-restrict-the-path-of-access-744892/)

PhloxLot 08-03-2009 08:01 PM

How do I capture a file-->open command and restrict the path of access
 
I have a jail setup on a server where my students logon using ssh and they program using vim. My jail setup currently allows them to only work in the directory /home/jail/home/username and only issue select shell commands. I would like to extend the use of an editor or IDE but I don't know how to prevent them from going "up-stream"(outside of their own folder) when they do a file-->open or save from the editor.

When they open an editor from their ssh terminal window, are they opening a child process or an completely independent process? If they are opening a child process, I have a script that filters their commands and limits what they can do. I would think that I could filter commands issued from the editor within this script. Correct? If not, how would I do it?

David1357 08-03-2009 09:54 PM

Quote:

Originally Posted by PhloxLot (Post 3630243)
I have a jail setup on a server where my students logon using ssh and they program using vim.

If they can use vim, and your jail is broken, then they would be able to open an arbitrary file.

Sergei Steshenko 08-03-2009 10:03 PM

Quote:

Originally Posted by PhloxLot (Post 3630243)
I have a jail setup on a server where my students logon using ssh and they program using vim. My jail setup currently allows them to only work in the directory /home/jail/home/username and only issue select shell commands. I would like to extend the use of an editor or IDE but I don't know how to prevent them from going "up-stream"(outside of their own folder) when they do a file-->open or save from the editor.

When they open an editor from their ssh terminal window, are they opening a child process or an completely independent process? If they are opening a child process, I have a script that filters their commands and limits what they can do. I would think that I could filter commands issued from the editor within this script. Correct? If not, how would I do it?

???

You are apparently on a UNIXish system, so write permissions (rather, lack thereof) prevents students from saving files elsewhere - provided the directories have the correct write permissions.

And I do not understand why you that jail in the first place, i.e. typical UNIXish setup is good enough.


All times are GMT -5. The time now is 01:35 PM.