Terminal de fechamento usando o comando 'login'

2

Estou usando o Centos 6.6. Sempre que eu uso login <username> , o terminal é desligado. Mas quando eu uso su - <username> funciona bem. Também tentei fazer o mesmo em uma sessão SSH e a sessão é fechada quando uso login <username> , mas funciona perfeitamente se eu usar su - <username> . Alguém já enfrentou esse problema antes? Em caso afirmativo, compartilhe a solução para o mesmo.

    
por Nick Miller 27.07.2015 / 11:24

1 resposta

7

man login

BUGS

A recursive login, as used to be possible in the good old days, no longer works; for most purposes su(1) is a satisfactory substitute. Indeed, for security reasons, login does a vhangup() system call to remove any possible listening processes on the tty. This is to avoid password sniffing. If one uses the command login, then the surrounding shell gets killed by vhangup() because it's no longer the true owner of the tty. This can be avoided by using exec login in a top-level shell or xterm.

  
    
por 27.07.2015 / 11:37

Tags