Operating System - Linux
1828389 Members
3123 Online
109977 Solutions
New Discussion

Re: How can start restricted bash from /etc/passwd

 
SOLVED
Go to solution
wvsa
Regular Advisor

How can start restricted bash from /etc/passwd

Greetings all;

Running redhat linux and would like to have a user run restricted bash (bash -r) when they login. Trying to figure out how I can do this, have seen references to rbash but have not seen rbash for redhat linux.

Thanks in advance for your help!

Norm
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: How can start restricted bash from /etc/passwd

Shalom Norm,

You can install rbash as a binary and if it works set it as a shell in /etc/shells and then use it in /etc/passwd as the shell

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
wvsa
Regular Advisor

Re: How can start restricted bash from /etc/passwd

Hello Stephen;

Where can I get rbash, could not find it via up2date, did not find it on the redhat site. Thanks for your input.

Norm
Ivan Krastev
Honored Contributor

Re: How can start restricted bash from /etc/passwd

Take a look at this FAQ from RH - http://kbase.redhat.com/faq/FAQ_43_3940.shtm

cheers,
ivan
Alexander Chuzhoy
Honored Contributor

Re: How can start restricted bash from /etc/passwd

IMHO,you don't need to install rbash:

cp /bin/bash /bin/rbash

and then edit /etc/passwd respectively (i.e. setting /bin/rbash as shell for certain account).
Ivan Ferreira
Honored Contributor
Solution

Re: How can start restricted bash from /etc/passwd

In fact, there is no need to copy the bash to rbash, just create a symlink and set that shell in the passwd file:

ln -s /bin/bash /bin/rbash
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
wvsa
Regular Advisor

Re: How can start restricted bash from /etc/passwd

Gentlemen;

The link of /bin/bash to /bin/rbash worked! That was exactly what I needed.

Thanks so much.

Norm