Limitando a 1 login por usuário

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

[ Hits: 6.115 ]

 


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

Identificando os seus discos

Manipulando o MySQL diretamente pelo shell

sed formatando CPF, CNPJ e datas

Atribuindo número de série da MikroTik Routerboard ao hostname

Filtro de conteúdo com iptables

Leitura recomendada

Obtendo acesso a hosts internos de uma rede remota com SSH

BGL (Bios, Grub e LXDM) - As três camadas de proteção

Quebrando senhas com John the Ripper!

Metasploit Framework no Linux

Lista de Livros de Segurança

  

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
Linux banner
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts