script for mounting an iso on another server
i need to mount a iso on another lin开发者_JS百科ux system
is there any way to send mount command to the linux system?
Thanks
SSH seems to be your best bet. Although I have never used it, http://commandline.org.uk/python/sftp-python-really-simple-ssh/ seems to be a good option.
import ssh
s = ssh.Connection('[Target Machine]')
s.execute('mount -o loop [ISO File] [Mount Point]')
s.close()
import subprocess
subprocess.call(['ssh', 'user@host', 'mount', '-o', 'loop', '-t', 'iso9660', '<isofilename>', '<mountpoint>'])
精彩评论