What i want to build is this:
Sending a command to another computer and get the results back on the computer where i started on.
Additional info:
I have a web server running with python on 192.168.10.100:5000.
When i go to this address i get a web page and on this web page you'll this:
PC1
192.168.10.110
textbox[type your command]
button[send command to this computer]
PC2
192.168.10.120
textbox[type your command]
button[send command to this computer]
So when i type in a command in the textbox of the first pc (i.e. ipconfig) and i click on the button, i want that the command is send to the first computer, and that the first computer executes the (ipconfig) command and sends the result back to the webserver (192.168.10.100) and presents the results on the screen.
I already have the webserver running in python and the website is also build and i can also send a command to the webserver itself and get that result back. The only problem is that i don't know how to send the command to another computer.
This is the code to do commands locally on this webserver:
POST=cgi.FieldStorage()
cmd=POST['commando'].value
def voerUIT (commando):
uitvoer = subprocess.Popen(commando, shell=True, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
return uitvoer
if cmd:
doe = voerUIT(cmd)
for x in doe.stdout.readlines():
print ( x.decode()+ '<br />' )