Sesi Tanya & Jawab Hari ini hadir untuk memberi kami SuperUser - subdivisi Stack Exchange, pengelompokan situs web Q & A berbasis komunitas.
Pertanyaan
Pembaca SuperUser user110971 ingin tahu bagaimana menjaga password tidak terlihat ketika menjalankan perintah sebagai argumen 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.
Bagaimana Anda bisa menjaga kata sandi tidak terlihat saat menjalankan perintah sebagai argumen SSH?
Jawabannya
Kontributor SuperUser Toby Speight memiliki jawabannya untuk kami:
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.
Memiliki sesuatu untuk ditambahkan ke penjelasan? Bicaralah di komentar. Ingin membaca lebih banyak jawaban dari pengguna Stack Exchange yang paham teknologi lainnya? Lihat diskusi lengkap di sini.
Kredit Gambar: Tampilan Linux (Flickr)