After the script calls SSH, the following error occurs: pseudo-terminal will not be allocated because stdin is not a terminal.

Source: Internet
Author: User

In the most recently completed project, we used SSH remote login to the specified server. In command mode, we can directly use SSH + IP (by setting a password that does not require a user ), for example, ssh 10.22.19.54, use exit to exit the service on the local machine. To complete some automation work, I will implement this code using the following shell method:

G_log = "/home/admin/call. log"
G_var = $ *

SSH 10.22.19.54> $ g_log <EOF
Echo "I am 54 now ."
Echo "$ g_var"

/Home/admin // disp/ADB. Sh "$ g_var"

Exit
EOF

However, during debugging, we found a very depressing problem. After each script is called, the following error is reported:

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

TERM environment variable not set.

In addition, our scripts are called through java. After the Java thread is called, we find that the shell has not exited, causing the system resources to be occupied. In the case of a large number of users, the system will soon be unable to support it. This problem must be solved as soon as possible.

I searched the internet for a long time and found a lot of similar problems. After reading this, consult with our SA engineers. We recommend that you add a parameter-TT to try it. The result is displayed after a try, and the speed is very fast. Sure.

Summary. When a shell script calls SSH, you must add parameters to indicate that this is a script call.

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.