Limitando a 1 login por usuário

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

[ Hits: 6.199 ]

 


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

Conhecendo o printf

Cache de conteúdo dinâmico com o Squid

Obtendo o Dockerfile a partir de uma imagem

Eliminando o Neighbour table overflow

Estendendo, à quase eternidade, a vida útil do SD card no Raspberry Pi

Leitura recomendada

Conheça o PacketFence - Ferramenta para controle de acesso a rede

Buffer Overflow para Pentesters - Vídeo aula

Projeto Root - Servidor de LOG no Debian

Introdução ao Hydra - Brute-force

Ubuntu 11.10 - Manter Limpo o Histórico de Documentos Recentes

  

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

chcvnjxhcxjchxjchxjcxhcxjcxhcjxchjxhcjxhcjxchxjhcjxhcxjhcxj vhxg xhcgxghcxgfcggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg



Contribuir com comentário