LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-03-2009, 08:01 PM   #1
PhloxLot
LQ Newbie
 
Registered: Aug 2009
Location: Staten Island, NY
Distribution: Ubuntu 8.04
Posts: 3

Rep: Reputation: 0
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?

Last edited by PhloxLot; 08-03-2009 at 08:04 PM.
 
Old 08-03-2009, 09:54 PM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by PhloxLot View Post
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.
 
Old 08-03-2009, 10:03 PM   #3
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by PhloxLot View Post
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.
 
  


Reply

Tags
editor, path, ssh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit words to upper case without delete anything from source file cgcamal Programming 9 01-17-2009 06:06 AM
can't capture 'at' command standard output to a file bartoni Linux - General 3 02-28-2006 03:52 PM
Best file to edit to add to PATH compguy81 Ubuntu 3 01-05-2006 08:19 AM
Edit User Command Path dwpondscum Linux - Distributions 2 06-10-2003 10:51 AM
how to edit a file when not in X (ie from the command line) ludwig W Linux - Newbie 12 04-22-2003 04:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration