Inexplicable errors caused by SSH Automation

Source: Internet
Author: User

The Code is as follows:

Ssh-Q [email protected] <EOF Ping-C 3 localhosteof

The following message is displayed:

Pseudo-terminal will not be allocated because stdin is not a terminal.

Google, someone suggested adding the-T (ssh-T-Q [email protected]) parameter to avoid this situation. As described in this article:

Http://buralin.iteye.com/blog/2035691

Parameter description:

-T disable pseudo-tty allocation. -t force pseudo-tty allocation. this can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. multiple-T options force tty allocation, even if SSH has no local TTY.

Based on the above, we can see that when you call a script that uses SSH automation, the current role is assigned a tty after logging on to the remote through SSH, but an error is reported because the current logon mode is not the local mode.

So use-t to disable this behavior.

Inexplicable errors caused by SSH Automation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.