Enabling tty in an ssh session

I would take some login information for a script that was written for use by many users. In python, I set input_raw to read from dev / tty, but it fails when I connect to a script running on the server via ssh.

Thoughts? Workarounds?

I would prefer to avoid hard coded user names in a script.

Please thanks.

+4
source share
1 answer

Try using the -t option 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, eg when implementing menu services.  Multiple -t
              options force tty allocation, even if ssh has no local tty.

There is no equivalent option in ~/.ssh/config , so you will need to create a shell script. Plain:

 #!/bin/sh ssh -t "$*" 

Save this as ssh-t or something, chmod +x ssh-t and put it somewhere in your PATH . Then set GIT_SSH=ssh-t to tell Git to use this script.

+5
source

All Articles