openssh-wrapper.

wrapper openssh python
Scarica ora

openssh-wrapper. Classifica e riepilogo

Annuncio pubblicitario

  • Rating:
  • Licenza:
  • BSD License
  • Nome editore:
  • NetAngels team
  • Sito web dell'editore:
  • https://github.com/NetAngels/

openssh-wrapper. Tag


openssh-wrapper. Descrizione

Wrapper openssh python. In alcuni circostanze, il wrapper, il wrapper, l'utilità di comando di OpenSsh SSH è più preferibile che il Machinery Paramiko.OpensSh-Wrapper propone ancora un altro involucro sottile con SSH per eseguire comandi sui server remoti. Tutto ciò che ti serve per assicurarsi che il client openssh e l'interprete di Python siano installati, quindi installare il pacchetto opensssh-wrapper. Esecuzione del comando SamplesIsimple Esecuzione del comando >>> Da OpenSSH_WRAPPER Importa SSHCONNECNECTION >>> CONN = SSHCONNECTION ('localhost', 'root') >>> Ret = Conn.Run ('whoami') >>> Print RetCommand: whoamistout: rootstderr: ritorno di ritorno: 0 >>> ret.command'whaami '>>> ret.stdout'root' >>> ret.stderr '' >>> ret.returncode0if Python Interpreter è installato su una macchina remota, è anche possibile eseguire pezzi di codice Python da remoto. Lo stesso è vero per qualsiasi altro interprete che può eseguire il codice da stdin >>> ret = connec.run ('whoami') >>> stampa Conn.Run ('Stampa "Hello World"', interprete = '/ usr / bin /Python').Stdouthello Worldyet Un'altra opzione di metodo di esecuzione per l'uso è inoltrata_ssh_agent (la funzione che paramiko non ha ancora). Supponiamo che tu abbia accesso come supporto al server Foobar mentre root @ localhost no, in modo da poter sfruttare l'inoltro dell'agente SSH $ Eval `ssh-agenti-agente PID PID 5272 $ SSH-ADDDRIDENDITY aggiunto: /Home/me/.ssh/id_rsa (/home/ #e/.ssh/id_rsa)$ Python >>> Conn = sshconnection ('localhost', 'root') >>> Stampa Conn.Run ('Supporto SSH @ Foobar "whoami"', forward_ssh_agent = true ) .stdoutsupportand Infine c'è un esempio che mostra come copiare un file dal computer locale a remoto >>> fd = open ('test.txt', 'w') >>> fd.write ('hello world')> >> fd.Close () >>> da openssh_wrapper import sshconnection >>> conn = sshconnection ('localhost', 'root') >>> CONN.SCP ('TEST.TXT', TARGET = '/ TMP')> >> Stampa Conn.Run ('Cat /tmp/test.txt').Stizia.Stdouthello Requisiti del Mondo: · Python.


openssh-wrapper. Software correlato

Ooch.

Python -Mooch (condivisione di file su una LAN Made Kinda Easy) ...

148

Scarica