在往集群上更新东西时需要重启机器 一台台重启是个噩梦 100多台 批量 ssh hostname reboot
有没root权限 ssh hostname sudo -s reboot
报 sorry, you must have a tty to run sudo 很多说注释什么/etc/sudoers 里
#Default requiretty
没发现这里有 这东西
最终解决 方法
ssh -i /opt/key.pem -t 10.162.241.88 sudo -s reboot
就是那个 -t
有没root权限 ssh hostname sudo -s reboot
报 sorry, you must have a tty to run sudo 很多说注释什么/etc/sudoers 里
#Default requiretty
没发现这里有 这东西
最终解决 方法
ssh -i /opt/key.pem -t 10.162.241.88 sudo -s reboot
就是那个 -t