Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- import time
- strComputers = ['10.2.2.35']
- strUser = 'root'
- strPwd = 'openelec'
- youtubelink = raw_input('Enter a youtube ID: ')
- convert = 'chromium --start-fullscreen https://www.youtube.com/embed/' + youtubelink + '?autoplay=1 & \n'
- # killall chromium &&
- # hosts = ['10.2.2.35,root,openelec']
- # connections = []
- """Connect to all hosts in the hosts list"""
- for host in strComputers:
- client = paramiko.SSHClient()
- client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- client.connect(strComputers[0], username=strUser, password=strPwd)
- # connections.append(client)
- channel = client.invoke_shell()
- channel.send(convert)
- time.sleep(3)
- client.close()
- print('Connection closed.')
- # client = paramiko.SSHClient()
- # client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- # client.connect(hostname=strComputer, username=strUser, password=strPwd)
- # output = channel.recv(2024)
- # print(output)
- # Close the connection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement