[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: Re: Shell-Creation.
At 8/18/00 3:11:00 PM, you wrote:
>Hi everybody,
>I was expecting few replies from all of U.
>Any more pointers to the same->, I want a shell
>which has root permissions of wring some system files under
>/etc, but should not have many other commands which usual shells
>have.
>Thanks in anticipation,
>Madhu Sudhan.S
>
>Dwivedi Ajay kumar wrote:
>
>> On Mon, 14 Aug 2000, Madhu Sudhan.S wrote:
>>
>> > Can any one on the list please educate me on how to Create a private
>> > Unix Shell of my own, allowing only a few basic simple commands on that
>>
>> There is a thing like bash --restricted. It does restrict
>> changing the PATH variable and cd'ing above the home directory. I hope you
>> can set the PATH variable to ~/bin, copy the commands you want him to use
>> to ~/bin. The shell will not allow it to use the commands like /usr/bin or
>> anyother with a / in the command.
>>
>> > to work on that, like the ls, cd, etc.,. Other commands, like su, etc.,
>> > should
>> > throw an error "Command not found".
>>
>> Hopefully reading the docs will give u the complete info.
make a simple program which runs on bash , accept commands ,strip off the path from the command (if
any) just add the path of dir where u keep the binaries u wanna run & exec it .
restricting CD to particular dir & its subdirs can be implemented using system calls . one way to do that
is save CWD,, change to the specified dir , check if new CWD starts with your home dir . if yes its ok
else CD to old CWD & print error
do u want code ?
_________
deepak
>>
>> Bye and EnjoyLife....
>> --
>>
>> #!!! If anything can go wrong, _FIX_ it. (To hell with MURPHY)
>>
>> Ajay kumar Dwivedi
>> ajayd@xxxxxxxxxx
>>
>> ---------------------------------------------
>> The mailing list archives are available at
>> http://lists.linux-india.org/cgi-bin/wilma/LIP
>
>
>---------------------------------------------
>LIP is all for free speech. But it was created
>for a purpose. Violations of the rules of
>this list will result in stern action.
>
>
-----------------------------
reply soon
bye
__ deepak __
have a great day
ICQ 30662394
-- The world is coming to an end... SAVE YOUR BUFFERS!!