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,可以解决你的问题。
相关阅读
等寿命设计的英文怎么说?谁能通俗易懂地解释一下Solid State是学什么的如何检测微波?有没有作CMP的?求助: 英文翻译Re: 有没有环境工程的?[转载] 关于engineering版更名的建议Re: [转载] 申请civil engineer(土木工程)俱乐部计算机读哪个方向的master好这里有谁做光纤传感器的研究吗?[转载] an online book: Finite Element Analysis恳请有工程背景的大虾指导[转载] 问个卷积问题FE/EIT Exama question about CWT[转载] mems problemAspen+:how to code conditional sequences[转载] 问个软件-AUTO-的问题Re: Can somebody recommend a book?[转载] pls recommend groups on optoelectronics