Answer the question
In order to leave comments, you need to log in
How to pass data to a program on STDIN?
Hello.
Often one has to face the need to transmit predefined responses to requests from various applications. The question is how to transfer this data? Let's say we have this code (to demonstrate the problem):
user=User
password=Password
server=1.2.3.4
echo "$password" | ssh "$user@$server"
Answer the question
In order to leave comments, you need to log in
Ssh (and many other programs) do not read the password from stdin, but directly from the terminal, for security reasons. There are crutches for ssh
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question