1833767 Members
2238 Online
110063 Solutions
New Discussion

Restrited Shell

 
Isaac_4
Frequent Advisor

Restrited Shell

Hi:
I need create a user with limited rigths, but i need that user run some commands, and need to that user don´t use de command CD to move a other directory.
I create it using rsh shell but y can´t run the process the i need, because the system sendme a messages you cant run a command using restrited shell,

Some one have a idea about this ?

The time is gold
3 REPLIES 3
Joseph Loo
Honored Contributor

Re: Restrited Shell

hi,

wat is the shell used for that user (with restricted shell)? u may like to verify in /etc/passwd.

for info, /usr/bin/rsh will allow the user to run in restricted shell.

regards.
what you do not see does not mean you should not believe
Bill Hassell
Honored Contributor

Re: Restrited Shell

All restricted shells are extremely restricted. The shell uses chroot to establish the root directory as the user's HOME. There is nothing visibile to this user above their own directory. That is what prevents the user from CD'ing to a higher directory. In order to run an application, all the execurbles, any needed libraries and all config files must be copied to the user's HOME in a manner that allows the program(s) to run. This is usually so complicated that it is impractical to implement.

What you7 need to do is replace the user's shell with a menu script or program that only allows the tasks listed in the menu. And any attempt to break out of the menu will automnatically log off the user.


Bill Hassell, sysadmin
Ivan Ferreira
Honored Contributor

Re: Restrited Shell

I have a different concept about the restricted shell, with restricted shell, users are not in a chroot environment, but they cannot issue any command that contains a slash. So, basically, you put the allowed commands for the users to the $HOME/bin directory with a symbolic link, and modify the PATH variable for the users in their profiles indicating only $HOME/bin. The users are restricted to run the commands in $HOME/bin only in that way.

http://www.unix.org.ua/orelly/unix/ksh/ch10_03.htm
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?