This is not a duplicate of this question. I log into a remote server using ssh with a key pair (no password needed). On the remote server, there's a script of mine needing a password for something else.
When I log in and execute the script, I get prompted, enter the password and everything is fine:
my-local> ssh my-remote
my-remote> ./my-script
Password for something else: ***
OK
my-remote> exit
When I try to do it in a single step, I get an error like
my-local> ssh my-remote ./my-script
fatal: could not read Password for .... No such device or address
I wouldn't really mind entering the password, if I only could.
However, as a side question, I'd like to know if it's possible to pass the PW from "my-local" in a secure way (I don't want to store it in the script on "my-remote").
Both servers are Ubuntu 16.04.
/dev/tty/
, but I somehow though,ssh
could forward my TTY. It should be possible, whenexcept
can do it. I'll look into it. – maaartinus Dec 06 '16 at 03:17