天天看点

RF采用SSHLibary库执行sudo命令,提示sudo: sorry, you must have a tty to run sudo错误的解决办法

RF采用SSHLibary库执行sudo命令,提示sudo: sorry, you must have a tty to run sudo错误的解决办法
RF采用SSHLibary库执行sudo命令,提示sudo: sorry, you must have a tty to run sudo错误的解决办法

经了解​​Execute Command​​​ and ​​Start Command​​两个关键字执行linux命令会新增一个shell,并且可能改变环境配置,如果要确保环境不被改变,则需采用Write和Read方法,该方法是在交互的shell中执行linux环境,不改变环境配置。具体区别如下: 

RF采用SSHLibary库执行sudo命令,提示sudo: sorry, you must have a tty to run sudo错误的解决办法

 采用该方法后即可解决“sudo: sorry, you must have a tty to run sudo”的问题:

RF采用SSHLibary库执行sudo命令,提示sudo: sorry, you must have a tty to run sudo错误的解决办法
RF采用SSHLibary库执行sudo命令,提示sudo: sorry, you must have a tty to run sudo错误的解决办法