Create a pipe to /dev/tty

Hello everybody:
I have a child process which reads a password from /dev/tty, as far as I know file descriptors for the child process can be seen by using lsof, so I want to connect to such device in order to send the password through a pipe, how could I do that?

As I understand it, you're trying to login with a password noninteractively? These commands read from /dev/tty as a security feature, to prevent people from being able to login with stored plaintext passwords. In other words, a less-than-subtle hint that you're not supposed to be using stored passwords to login.

Would it be possible to use ssh for this? It supports noninteractive login methods such as keys. Or configure your system to let you and only you login to one and only one specific thing without a password via the sudo utility.

Worst case, if you absolutely must, you might be able to fool it with things like the expect tool, but this is convoluted and very hard to make secure.

1 Like

hi Corona688:

Sadly the account which I'm trying to connect to doesn't have access for ssh, and probably sudo won't be available in other locations where the application is going to be installed.

Thanks for your response