What is cmdStr set to, and how are you initialising sshObj? Essentially, can you give us a complete piece of code that runs properly, the output you get when running it, and the output you expect?
EDIT: Wait, are you trying to run a 'sudo' command? In which case the 'Password:' prompt is not the last line of the login, but a request for the sudo password. Just add:
Code:
in.write('password\n')
in.flush()
then the command output should be written to 'out'.