I would to take in some login information for a script have written in to be used by many users. In python I set the input_raw to read from dev/tty but it fails horribly when i am connecting to the script being run on a server through ssh.
Thoughts? Workarounds?
I would prefer to avoid hard coding usernames into the script.
Please and thank you.
Try using the
-toption to ssh:-t Force pseudo-tty allocation. This can be used to execute arbi- trary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.There doesn’t seem to be an equivalent option in
~/.ssh/config, so you will need to create a shell script. A simple one is:Save this as
ssh-tor something,chmod +x ssh-t, and put it somewhere in yourPATH. Then setGIT_SSH=ssh-tto tell Git to use this script.