ssh 远程 命令需要 sudo 时 , 加参数 -t

ssh -t lab@${ip} 'sudo make install; exit'

原文地址:https://www.cnblogs.com/rabitvision/p/13640409.html