. Advertisement .
..3..
. Advertisement .
..4..
As the title says, I am getting the “pseudo-terminal will not be allocated because stdin is not a terminal.” error. How can I fix it so the error goes away? Here is my detail:
j@ubuntu:~/tmp/1030$
j@ubuntu:~/tmp/1030$ ssh -T 192.168.171.161 <<EOF
> uptime
> date
> EOF
Pseudo-terminal will not be allocated because stdin is not a terminal.
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.11.0-37-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
301 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable
Your Hardware Enablement Stack (HWE) is supported until April 2025.
*** System restart required ***
01:32:23 up 23:05, 1 user, load average: 0.00, 0.00, 0.00
Sun 31 Oct 2021 01:32:23 AM PDT
j@ubuntu:~/tmp/1030$
When I operated it and I received the error text:
Pseudo-terminal will not be allocated because stdin is not a terminal.
I appreciate any help from you.
The cause: No command is specified for ssh while stdin is redirected from a here document or pip.
Solution: Use ssh option
-q
Where option
-q
means:Also available with option
-T
manual