ssh过去一个linux设备(10.107.11.1 root Sangfor@123),运行命令,写成一句shell

你可以使用以下命令通过 SSH 连接到 Linux 设备并运行 pwd 命令:


sshpass -p 'Sangfor@123' ssh [email protected] 'pwd'


请确保你已经安装了 sshpass 工具,以便在命令中直接传递密码。

你可能感兴趣的:(linux,linux,ssh,运维)