top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Secure python environment with web terminal emulator

+1 vote

We have a server running a web-based terminal emulator (based on shellinabox for screen-casting check that allows users to learn simple bash commands. This Linux environment secured by things like quota, selinux,ulimit etc

Now some users are requesting python access. How to ensure python is executed in a restricted environment. I came across
but it seems like disabled in 2.3. Any thoughts on how we can safely provide python access to users.

posted Aug 6, 2013 by Mandeep Sehgal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

When you are satisfied with the protection you have achieved for bash commands, those same protection might be sufficient for Python as well. I assume that you used operating system facilities to restrict what the (system) user can do on the operating system level: the same restriction would apply to the (same) user executing Python code.

answer Aug 7, 2013 by anonymous
Yes, we used OS features to restrict the system user accounts.

We don't allow gcc - this helped us to avoid kernel exploits via C code like :

We are concerned whether user may try C exploits via Python code and break the system. What's the minimal python set-up you would suggest? I'm thinking something like:

1- Uninstall python-devel packages
2- Remove easy_install or pip (any such install utilities)
3- Keep only very basic modules under /usr/lib/python/site-packages and delete the others.
Similar Questions
0 votes

Is there any command available to view the installed libraries. Please suggest.

+1 vote

I have learnt python and used it for various purposes for scietific computing using sage and GUI development using Tkinter and lots more. I want to start web development using python My goal is to learn the web development in python from the basic level and understand the big web development projects like Django , MoinMoin Wiki , Plone and network programming further with twisted.
I have found Web2Py to be an easy library to quickly use and develop the web application. Is there any other library to start my development with. anddoes my plan of learning Web2Py is good for Web development and getting involved in the big projects like Django , MoinMoin Wiki , Plone.

0 votes

I want to submit a qsub job to my hpc cluster from within python. In this case, I must set some environment variables specific for this qsub job and then invoking a bash script from within python.

What python code should be used for this job?

+1 vote

I want to install in my Python 3.4 environment on a Centos 5 box. My /usr/local/bin/ contains:


We are behind a proxy server and I tried this:

# /usr/local/bin/easy_install-3.4 

Searching for 
Download error on hostname '  
' doesn't match either of '', '', '',  
'', '', '', '',  
'', '', '', '',  
'', '', '', '' --  
Some packages may not be found! 

Couldn't find index page for '' (maybe misspelled?), Am I best to use pip or easy_install? also if easy_install, how can I fix the above error?

0 votes

I want to use python for creating dynamic database driven websites. and I don't want to use existing web frameworks for my work. I am learning things so I wont feel lazy to write all the code myself because I want to learn.

could anyone suggest me any books/site from where I can start. I want to follow MVC architecture. so please suggest me some links/book or anything