在另一台服务器上安装iso的脚本

问题描述:

我需要在另一个linux系统上安装iso在另一台服务器上安装iso的脚本

有没有办法将mount命令发送到linux系统?

谢谢

SSH似乎是你最好的选择。虽然我从未使用过,但http://commandline.org.uk/python/sftp-python-really-simple-ssh/似乎是一个不错的选择。

import ssh 
s = ssh.Connection('[Target Machine]') 
s.execute('mount -o loop [ISO File] [Mount Point]') 
s.close() 

import subprocess 
subprocess.call(['ssh', '[email protected]', 'mount', '-o', 'loop', '-t', 'iso9660', '<isofilename>', '<mountpoint>'])