ssh on solaris 8

Robin Munn rmunn at pobox.com
Thu Oct 17 17:15:06 EDT 2002


In article <1939577.1034857505 at dbforums.com>, Cypher7 wrote:
> 
> The problem with using os.system to envoke ssh is that I need the
> program to beable to send the commands to the remote system.
> Because ssh enmulates a terminal I cannot use os.popen to connect
> pipes.  If anyone knows a way to do a ssh connection in a scripted
> fassion that would also fix my problem because I could have python
> generate the script.
> 
> The program I'm making is for automated system recovery of a daemon that
> runs both locally and remotely.  I don't have the authority to write a
> program on the remote system, but can exececute commands at the shell
> prompt throgh ssh.

Is there some reason why this wouldn't work?

    os.system('/usr/local/bin/ssh remotehost command')

If you have an SSH public/private key pair set up by running ssh-keygen,
you can set it up so that the SSH connection won't require a terminal
because it uses the key pair instead of a password for authentication. I
found chapter 6 of the O'Reilly SSH book very helpful in setting this up
for myself.

-- 
Robin Munn <rmunn at pobox.com>
http://www.rmunn.com/             PGP key ID: 0x6AFB6838
PGP key fingerprint: 50FF 2478 CFFB 081A 8338  54F7 845D ACFD 6AFB 6838



More information about the Python-list mailing list