471,310 Members | 1,214 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

Executing commands in a remote machine using python

vinoj
3
Hi All,
These are the following things which i want to do:-[list]
1. I will be taking the ipaddress, username and password from the user using cgi ffrom the browser.
2. Now i want to get the mac address which i can get by connecting to the remote machine and by executing ifconfig command.

Now to connect to a remote machine in python i tried using pexpect module by which i can ssh to remote machine and get the mac address.

I was successful in using the pexpect module but its working only from the linux terminal i.e. when i run the program at the command prompt, but when i use that program through cgi, it gives me a pexpect exception which is as follows.


pexpect.ExceptionPexpect: Error! pty.fork() failed: out of pty devices\

Am i using the right module plz help me out.....................
Thank You,
Vinoj Davis
Jan 2 '08 #1
0 1681

Post your reply

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.