shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Desabilitar CTRL-C ou CTRL-Z


From: Tiago Barcellos Peczenyj
Subject: Re: [shell-script] Desabilitar CTRL-C ou CTRL-Z
Date: Fri, 29 Feb 2008 13:46:14 -0300

Se vc não quer que o usuario caia no shell, tente usar outras opções
de segurança como um chroot para que o mesmo não possa sair do
diretorio em questão.

A sua unica forma de proteção não pode ser um trap: use o comando
shopt para habilitar algumas coisas como o restricted_shell

Direto do Man Bash:

RESTRICTED SHELL
       If bash is started with the name rbash, or the -r option is
supplied at invocation, the shell becomes restricted.  A restricted
shell is used to set up an  environment  more  controlled
       than the standard shell.  It behaves identically to bash with
the exception that the following are disallowed or not performed:

       ·      changing directories with cd
       ·      setting or unsetting the values of SHELL, PATH, ENV, or BASH_ENV
       ·      specifying command names containing /
       ·      specifying a file name containing a / as an argument to
the .  builtin command
       ·      Specifying a filename containing a slash as an argument
to the -p option to the hash builtin command
       ·      importing function definitions from the shell
environment at startup
       ·      parsing the value of SHELLOPTS from the shell
environment at startup
       ·      redirecting output using the >, >|, <>, >&, &>, and >>
redirection operators
       ·      using the exec builtin command to replace the shell with
another command
       ·      adding or deleting builtin commands with the -f and -d
options to the enable builtin command
       ·      Using the enable builtin command to enable disabled shell builtins
       ·      specifying the -p option to the command builtin command
       ·      turning off restricted mode with set +r or set +o restricted.
       These restrictions are enforced after any startup files are read.

       When a command that is found to be a shell script is executed
(see COMMAND EXECUTION above), rbash turns off any restrictions in the
shell spawned to execute the script.



2008/2/29 Bruno Criado <address@hidden>:
>
>
>
>
>
>
> Boa tarde.
>
>  Tenho uma dúvida, como posso desabilitar um ctrl-c ou ctrl-z em um
>  Shellscript, impossibilitando assim que o usuário caia no Shell.
>
>  Obrigado.
>
>  Atenciosamente,
>
>  Bruno Criado.
>
>  [As partes desta mensagem que não continham texto foram removidas]
>
>  



-- 
Tiago B Peczenyj
Linux User #405772

http://peczenyj.blogspot.com/
"what does not kill us makes us stronger"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]