Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 07-09-2008, 12:01 PM   #1
Registered: Dec 2004
Location: India
Distribution: ubuntu 10.04 , centos 5.5 , Debian lenny, Freenas
Posts: 324

Rep: Reputation: 36
Question restricted shell

Dear all,

this is what i have read in the book ubuntu linux unleashed,

if you have a desire to severly restrict what a user can do, you can provide him with a restricted shell. to run a restricted bash shell, you would use the -r option

ex:- bash -r

then try to do something that you could do as a regular user, such as
ls -a,

you will then see

bash: ls: no such file or directory

now my question is suppose i have my shell restricted, how to make it back un restricted ?
Old 07-09-2008, 02:29 PM   #2
Mr. C.
Senior Member
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 62
If you changed your own shell to restricted, and have no access to another account in which to become root, you'll have to boot from a livecd / rescue CD to change it back. Since the restricted shell prevents you from specifing any command with a / in the pathname, and you can't change your PATH, you are stuck.
Old 07-09-2008, 03:00 PM   #3
Registered: Jul 2008
Posts: 70

Rep: Reputation: 16

I don't advise you to use restricted bash shells..
There are better choices like chroot, jail shells and others.
And definitely you shouldn't do it to yourself, especially if you're using the root account (which many security experts don't recommend).


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
Restricted Shell help rtaft Linux - Security 3 04-01-2008 12:51 PM
need more restricted shell then rbash redss Linux - General 3 01-26-2006 09:55 AM
Restricted Shell in RedHat 6.2 yuzuohong Linux - General 1 03-20-2003 09:06 AM
Restricted shell Rocket01 Linux - Software 3 01-23-2003 09:37 PM
Restricted Shell johnlee Linux - Security 3 10-29-2001 08:02 AM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:28 PM.

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