La sessione di domande e risposte di oggi ci viene fornita per gentile concessione di SuperUser, una suddivisione di Stack Exchange, un raggruppamento di domande e risposte basato sulla comunità.
La domanda
Il lettore SuperUser user110971 vuole sapere come mantenere le password invisibili quando si esegue un comando come argomento SSH:
If I run this command and start typing the MySQL password, the password is visible on the screen:
ssh user@server ‘mysql -u user -p’
How can I prevent this? If I log in through SSH and execute the MySQL command, then everything works fine.
Come si possono mantenere le password invisibili quando si esegue un comando come argomento SSH?
La risposta
Il collaboratore SuperUser Toby Speight ha la risposta per noi:
If you provide a remote command to run, SSH does not allocate a tty, so the remote command is unable to disable echo. You can force SSH to provide a tty using the -t option:
ssh -t user@server ‘mysql -u user -p’
The equivalent option (for -o or for the config file) is RequestTTY. I would caution against using it in the config file because it can have unwanted effects for non-interactive commands.
Hai qualcosa da aggiungere alla spiegazione? Audio disattivato nei commenti. Vuoi leggere più risposte dagli altri utenti di Stack Exchange esperti di tecnologia? Controlla la discussione completa qui.
Immagine di credito: Linux Screenshots (Flickr)