Limitando a 1 login por usuário

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

[ Hits: 6.828 ]

 


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

Compilando um novo kernel herdando as configurações do antigo

Construindo bridges Tor com Docker

IP estático no Amazon Linux

Comando sed para formatar datas

Criando uma imagem Docker a partir de uma máquina virtual

Leitura recomendada

Bloqueio do Ultra-Surf com firewall Iptables

Colocando senha criptografada no GRUB 2

NetGrok, uma ótima ferramenta para monitoramento

Bloqueando o Ultrasurf através do Netfilter/Iptables versão 10.08

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

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts