Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: SSH leaving terminal confused issue

by sgifford (Prior)
on Apr 24, 2007 at 14:34 UTC ( [id://611746]=note: print w/replies, xml ) Need Help??


in reply to SSH leaving terminal confused issue

ssh is probably opening /dev/tty, which is why adjusting filehandles beforehand doesn't help. One standard solution to the "program is opening terminal" problem is to use Expect, which will create a new terminal for the program to read from. This is a good general solution to the problem.

Another possibility is to use OpenSSH's BatchMode option. The docs say:

If set to “yes”, passphrase/password querying will be disabled. This option is useful in scripts and other batch jobs where no user is present to supply the password. The argument must be “yes” or “no”. The default is “no”.
which sounds like what you want. To use it from the command line, you would say something like:
ssh -o BatchMode=yes ...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://611746]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-29 12:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found