Сегодняшняя сессия вопросов и ответов приходит к нам благодаря SuperUser - подразделению Stack Exchange, основанной на сообществах сайтам Q & A.
Вопрос
Считыватель SuperUser user110971 хочет знать, как сохранить пароли невидимыми при запуске команды в качестве аргумента 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.
Как сохранить пароли невидимыми при запуске команды в качестве аргумента SSH?
Ответ
Ответчик SuperUser Тоби Спейт отвечает за нас:
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.
Есть что добавить к объяснению? Отключить звук в комментариях. Хотите узнать больше ответов от других пользователей Windows? Посмотрите здесь полную дискуссионную тему.
Image Credit: Скриншоты Linux (Flickr)