level 1
littles0907
楼主
rname命令?[问题点数:50分]
*
* littles0907
* (littles0907)
*
* 等 级:
* 结帖率:100.00%
*
楼主发表于:2009-08-11 11:14:14
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
输出结果
#################################################################
# #
# 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 #
2009年08月12日 01点08分
1
*
* littles0907
* (littles0907)
*
* 等 级:
* 结帖率:100.00%
*
楼主发表于:2009-08-11 11:14:14
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
输出结果
#################################################################
# #
# 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 #