[SSH] how to run the sudo suusername command?

Net::SSH.start('host', 'usr', :password => 'psswd') do |ssh|

channel = ssh.open_channel do |ch|
ch.exec "sudo suroot" do |ch, success|
raise "could not execute command" unless success
ch.on_data do |c, data|
puts data
end
ch.on_extended_data do |c, type, data|
puts data
end
ch.on_close { puts "done" }
end
end
end

The output results
#################################################################
# #
# This system is for the use of authorized users only. #
# Individuals using this computer system without #
# authority, or in excess of their authority, are #
# subject to having all of their activities on this #
# system monitored and recorded by system personnel. #
# #
# In the course of monitoring individuals improperly #
# using this system, or in the course of system #
# maintenance, the activities of authorized users #
# may also be monitored. #
# #
# Anyone using this system expressly consents to such #
# monitoring and is advised that if such monitoring #
# reveals possible evidence of criminal activity, #
# system personnel may provide the evidence of such #
# monitoring to law enforcement officials. #
# #
# This system/database contains restricted data. #
# #
#################################################################


Solaris OS: .....

Veritas VxVM: .....

Qlogic driver: ....

WWNs of installed QLA HBAs:
.......

stty: : Invalid argument
stty: :
Invalid argument
stty: : Invalid argument

stty: : Invalid argument
stty: : Invalid argument
########################################################################
########################################################################
## ##
## Version of JDK Supported in qa-batch host ##
## ------------------------------------------------- ##
## jre_1.5.0_06-b05 - Supported by wrapper class java15_06 ##
## ##
## jre1.5.0_09 - Supported by wrapper class java15_09 ##
## ##
## jdk1.6.0_13 - Supported by wrapper class java16_13 ##
## ##
## ##
########################################################################
########################################################################


Then stop here, no prompt, have forced abort to exit.
Which can help solve the problem.?

ps: Use other software such as SecureCRT can log normal and execution. I must write a program using ruby, remote login server the name, but do not know the password.
In SecureCRT will result in a prompt:
[ /home/root ]->
Then you can enter the other commands, such as Bash.

Started by Denny at November 17, 2016 - 2:12 PM

I

Posted by Dick at December 02, 2016 - 2:23 PM

The reply to 2009-09-25 10:50:10 was a moderator to delete

Posted by Verne at December 13, 2016 - 2:33 PM

If too

Posted by Horace at December 20, 2016 - 2:41 PM

The reply to 2009-09-28 09:38:29 was a moderator to delete

Posted by Adelaide at December 25, 2016 - 2:47 PM

The reply to 2009-11-05 09:20:25 was a moderator to delete

Posted by Albert at January 02, 2017 - 2:51 PM