how can i write ssh client using python socket?
Subhan
I haven't used it yet - but why don't you try paramiko?
Of course it is! In fact it is already implemented!!
See twisted.conch - the implementation is pure python using sockets!
twisted.conch