c*n
2 楼
我做如下的东西
Runtime.getRumtime().exec("ssh -t localhost sudo blahblah");
我想要这个sudo 的password prompt 自然转到terminal 上,然后人可以敲密码,
但现在它干脆就不读输入的密码---ssh 说stdin is not a terminal, 所以-t 不行。
谁有个办法?
另外注意我必须access terminal, not stdin, because many (most) applications
directly read the terminal when asking for passwd.
Runtime.getRumtime().exec("ssh -t localhost sudo blahblah");
我想要这个sudo 的password prompt 自然转到terminal 上,然后人可以敲密码,
但现在它干脆就不读输入的密码---ssh 说stdin is not a terminal, 所以-t 不行。
谁有个办法?
另外注意我必须access terminal, not stdin, because many (most) applications
directly read the terminal when asking for passwd.
h*q
3 楼
RT
h*0
5 楼
为啥不能用stdin做terminal?协议不对?
【在 c******n 的大作中提到】
: 我做如下的东西
: Runtime.getRumtime().exec("ssh -t localhost sudo blahblah");
: 我想要这个sudo 的password prompt 自然转到terminal 上,然后人可以敲密码,
: 但现在它干脆就不读输入的密码---ssh 说stdin is not a terminal, 所以-t 不行。
: 谁有个办法?
: 另外注意我必须access terminal, not stdin, because many (most) applications
: directly read the terminal when asking for passwd.
【在 c******n 的大作中提到】
: 我做如下的东西
: Runtime.getRumtime().exec("ssh -t localhost sudo blahblah");
: 我想要这个sudo 的password prompt 自然转到terminal 上,然后人可以敲密码,
: 但现在它干脆就不读输入的密码---ssh 说stdin is not a terminal, 所以-t 不行。
: 谁有个办法?
: 另外注意我必须access terminal, not stdin, because many (most) applications
: directly read the terminal when asking for passwd.
I*c
7 楼
使用开源ssh的java实现。我用过jsch,可以解决你的问题。
相关阅读
请教关于MATLAB中缺失数据的问题[转载] 这样的背景来加拿大如何?Help needed to access a dissertation[转载] RA openings at UTK[转载] SolidWorks vs Autodesk InventorSMM (System Management Mode)问题问个关于焊接的问题急!交通工程有人用piezoelectric ceramic吗有谁的图书馆有下面的关于超声的文章?[转载] 谁有dynamic light scattering的资料阿有在日本的朋友能帮个忙么?有没有人用materials studio模拟MOF(metal organic请问美国哪些学校EE比较好?请问一下了:做电机电源电机控制有没有前途啊?[转载] 急问数据拟合软件再请教--海边钢厂对海水的处理[转载] 问个matlab画图问题Dr. Pan Wei's new speech Good哪位大侠能推荐一本six sigma的参考书啊