On Mon, Dec 13, 2010 at 10:33 AM, Darshak Bavishi <bavishi.dars...@gmail.com > wrote:
> Hi Experts, > > I need to know that is there any way to SSH (From Windows Host) to Unix > machine ?! > > If Yes than How ? > > Because when i use telenet it not showing the no result !! As earlier it > was suggested that i should try with exit first and than read_all() > but still issue persist and getting hang > > import getpass > import sys > import telnetlib > import time > HOST = "*.*.*.*" > #user = raw_input("Enter your remote account: ") > #password = getpass.getpass() > user = "Darshak2" > password = "****" > tn = telnetlib.Telnet(HOST , 5400) > print "1" > tn.read_until("login:" , 5) > print "2" > tn.write(user + "\n") > print "3" > if password: > tn.read_until("Password: ") > tn.write(password + "\n") > > print "4" > tn.write("set alarm = off" + "\n") > tn.write("set event = off" + "\n") > print "5" > tn.write("Cd > /Office-Parameters/Mobility-Config-Parameters/Subscriber-Query-by-IMSI-MSISDN-or-IMEI" > + "\n") > print "6" > tn.write("\n") > tn.write("\n") > tn.write("vlrsubquery msisdn=***" + "\n") > tn.write("\n") > tn.write("exit" + "\n") > print tn.read_all() > tn.close() > > -- > BR > Darshak Bavishi > > -- > http://mail.python.org/mailman/listinfo/python-list > > you can try read_very_eager() which won't block. Twisted has complete support for SSH check it out http://twistedmatrix.com -- Thanks & Regards, Godson Gera Asterisk Consultant India <http://godson.in>
-- http://mail.python.org/mailman/listinfo/python-list