• Register
0 votes

Problem :

I am very new to Shell scripting. Currently I am trying to write the Shell Script which should create some dirs on my remote server and then it should use the scp to copy the files from the local pc on the remote server.
But whenever I try to run it I get below message:
“Pseudo-terminal will not be allocated because stdin is not a terminal.”

And my script hangs after the message. How to fix above message?

8 4 2
2,300 points

1 Answer

0 votes


I had faced this warning recently. The above listed message is because you have not specified any command for ssh while the stdin is redirected from the document. As there is no command is specified as an argument the ssh first expects the interactive login session but then it has to understand that its just a local stdin and not tty or pty. Redirecting ssh's stdin from your document generally needs the command (like /bin/sh) should be specified as the argument to the ssh and so in such cases no pty is allocated on your remote host by default.

So you need to use the following commands ssh -T user@server <<EOT or ssh user@server /bin/bash <<EOT and it will fix your warning.


5 2 1
4,980 points

Related questions

0 votes
1 answer 3 views
for x in {a..z}; do for y in $x*;do if [ "$y" != "$x*" ]; then let "count++" Can any one help me on what that 2nd for loop does?
asked Sep 15 Marivoke 530 points
0 votes
1 answer 9 views
I'm a newbie when it comes to Linux administration using bash... I was following a tutorial on how to install laravel 5.2 from here... installed it successfully... firstly I installed composer and ran the following command composer global require "laravel/installer" after this put ... the path Note: I have installed oh my zsh on my terminal... What do I have to do to get it working please help
asked Sep 13 Marivoke 530 points
1 vote
1 answer 12 views
Problem: Hello Kodlogs, I am a Linux user and currently running Ubuntu 18.04 LTS distribution on my machine. I&rsquo;ve written a sample python program and trying to execute it through the Linux terminal. My sample program is saved as samle.py and I put a command ... command not found Why this is happening? Could you please give a hint? How could I overcome the error? Thanks for enlightening me.
asked Aug 1 adamSw 11.3k points
0 votes
1 answer 38 views
Problem : I am beginner to CentOS. I tried executing sudo ./startup.sh in my CentOS, But I am facing the below error: "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined" I have already defined them in my bashrc as shown below: export JAVA_HOME=/home/mphil/New_learning/jdk1.8.0_212 export PATH=$JAVA_HOME/bin:$PATH How to fix this error?
asked Feb 27 mphil 2.3k points