Limitando a 1 login por usuário

Publicado por Carlos Affonso Henriques. em 10/07/2007

[ Hits: 6.827 ]

 


Limitando a 1 login por usuário



No Slackware o /etc/profile determina as variáveis de ambiente do Bash, bem como executa scripts de login.

Hoje precisei restringir 1 login por usuário apenas, e fiz o seguinte:

Se estiver usando o Slackware o arquivo é o /etc/profile, em outras distros pode ser também o /etc/bashrc.

Basta acrescentar a seguinte linha de comando neste arquivo:

if [ `wc -l <(who | fgrep $USER | cut -f1 -d" ") | cut -f1 -d" "` = 2 ];then exit; else :; fi

Pronto!

Bom trabalho.

Outras dicas deste autor

Cache de conteúdo dinâmico com o Squid

Executando comandos do Shell Bash pelo Python

Alterando o número de hops do Tor

CBQ: Controle efetivo II

Lógica booleana com o test

Leitura recomendada

Evitando IP spoofing

A importância de uma senha aleatória

SSHFS - Montando sistema de arquivos remotos via SSH (Secure Shell)

Como proteger seus dados no computador e smartphone?

Gerador de backdoor indetectável

  

Comentários
[1] Comentário enviado por sasa.tutia em 14/07/2007 - 13:55h

chcvnjxhcxjchxjchxjcxhcxjcxhcjxchjxhcjxhcjxchxjhcjxhcxjhcxj vhxg xhcgxghcxgfcggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg



Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts