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

Re: Script al login utente...



Alle 16:56, giovedì 10 marzo 2005, automatic_jack ha scritto:
> Ciao a tutti,
>
> ho la necessità di modificare alcune regole di iptables al login di un
> particolare utente ripristinando la situazioni iniziale al logout...ho
> letto di recente che il modulo pam_script potrebbe essermi d' aiuto, ma
> esso non è ancora incluso nella distribuzione ufficiale, mi chiedevo,
> quindi, se esistono ulteriori metodi che assolvano tale compito con
> particolare riguardo per le questioni di sicurezza connesse (i.e.
> trasparenza all' utente dei
> cambiamenti effettuati)

il login è in shell o in X?

nel primo caso potresti usare questi script...

/quote #man bash
INVOCATION
A login shell is one whose first character of argument zero is a -, or one 
started with the -login flag.

An interactive shell is one whose standard input and output are both connected 
to terminals (as determined by isatty(3)), or one started with the -i option. 
PS1 is set and $- includes i if bash is interactive, allowing a shell script 
or a startup file to test this state.

Login shells:
On login:
if /etc/profile exists, source it.

if ~/.bash_profile exists, source it, else if ~/.bash_login exists, source it, 
else if ~/.profile exists, source it.

On exit:
if ~/.bash_logout exists, source it.

Non-login interactive shells:
On startup:
if ~/.bashrc exists, source it.

Non-interactive shells:
On startup:
if the environment variable ENV is non-null, expand it and source the file it 
names, as if the command if [ "$ENV" ]; then . $ENV; fi had been executed, 
but do not use PATH to search for the pathname.
/endquote

byez
-- 
Gollum1
Tesssssoro, dov'é il mio tessssoro?



Reply to: