Limitando a 1 login por usuário

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

[ Hits: 6.236 ]

 


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

Proxy ARP: Abrindo um servidor da rede interna para a internet com a ferramenta ip

Alterando o MAC addrres de sua placa de rede

Executando comandos do Shell Bash pelo Python

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

Target TTL do Iptables: Contornando bloqueios de compartilhamento

Leitura recomendada

Análise de malware com Pyew

Restringindo acesso de usuários e grupos no SSH

Securing Apache2/PHP7 on Linux/Unix (Basic)

Limitar comandos que o usuário pede executar

Impedindo usuários de efetuar logon

  

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