stty antes do login

4

Temos algumas VMs de Integridade do HP-UX que são difíceis de efetuar login no console porque o caractere KILL está definido como @ , que também é um componente de algumas senhas. Agora eu sei que podemos contornar isso fazendo login como um usuário diferente e emitindo stty KILL '^U' , e isso já está no .login para todos os usuários. Eu também sei que usar \@ funcionará.

A verdadeira questão é o que eu preciso fazer para alterar o caractere KILL em todo o sistema, para que não tenhamos que alternar o login interativo ou evitar senhas com @ ?

    
por Sammitch 07.11.2012 / 21:13

1 resposta

1

/etc/inittab é o lugar para começar. O programa getty é usado para manipular a configuração inicial do terminal.

De acordo com a página de manual getty , ele possui uma opção que permite que ele use um arquivo de configuração que permite ao administrador definir caracteres especiais:

-f
Get the settings for special control characters from the /dev/ttyconf file. See the Special Control Characters section.

Essa seção fala pouco, mas aponta para a página de manual stty . Tem um pouco mais de informação:

The default values for the control characters may be changed by a user with root capability by using stty and redirecting stdin to the device /dev/ttyconf. Any of the four command forms specified in the Description section above may be used. However, only the control character defaults will be reported or altered. It will have no effect on the defaults for any of the other modes.

e dá um exemplo:

The command:

      stty kill '^X' intr '^C' werase '^W' </dev/ttyconf

sets the default values for the delete-line character to ^X (Ctrl-X), the interrupt character to ^C, and the word erase character to ^W. Any terminal port opened after this command is issued will see these new default values for the kill, intr, and werase control characters.

Considerando os comentários sobre a aplicação somente às portas de terminal abertas após , isso significa que você teria que modificar /etc/inittab para fazer essa inicialização.

De acordo com uma pesquisa na web em cache, isso é respondido na documentação da HP:

HP-UX System Administrator's Guide: Configuration Management: HP-UX 11i Version 3
Chapter 2 Configuring System Parameters
Changing Login Special Characters

e conclui com uma linha de exemplo para adicionar antes as linhas que lidam com o console e os terminais:

   ttc0::bootwait:/sbin/stty intr ^C erase ^H kill ^U < /dev/ttyconf

As linhas com getty também precisariam ter a opção -f adicionada.

Leitura adicional:

por 06.08.2016 / 02:26

Tags