Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的需要,我需要登录到服务器并以 root 身份执行命令。
这就是我写的:
sshpass -p "password" ssh -t user@ip "hostname & sudo su - root & vmquery -rn 0 -bx | grep -i scratch | wc -l"
问题是 VMQUERY 命令没有以 root 身份执行。任何解决方案都会有所帮助