From: Thufir Date: 2012-03-26T15:16:55+09:00 Subject: Re: net/ssh telnet set port 119 (nntp) you're right, when I read that last night I was a bit tired. I'm trying to look at the corresponding API for "non-ssh" telnet, to figure out how to login to leafnode and get the output printed to the screen. I just get timeouts so far: thufir@dur:~/ruby/ssh$ thufir@dur:~/ruby/ssh$ ruby ssh.rb trying to connect... # 0x00000: 54 72 79 69 6e 67 20 31 32 37 2e 30 2e 30 2e 31 Trying 127.0.0.1 # 0x00010: 2e 2e 2e 0a .... [1]+ Stopped ruby ssh.rb thufir@dur:~/ruby/ssh$ thufir@dur:~/ruby/ssh$ /home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/net- ssh-telnet-0.0.2/lib/net/ssh/telnet.rb:219:in `rescue in initialize': timed out while opening a connection to the host (Timeout::Error) from /home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/net-ssh- telnet-0.0.2/lib/net/ssh/telnet.rb:208:in `initialize' from ssh.rb:5:in `new' from ssh.rb:5:in `
' [1]+ Exit 1 ruby ssh.rb thufir@dur:~/ruby/ssh$ thufir@dur:~/ruby/ssh$ nl ssh.rb 1 require 'rubygems' 2 require 'net/ssh/telnet' 3 puts "trying to connect..." 4 s = Net::SSH::Telnet.new( 5 "Dump_log" => "/dev/stdout", 6 "Host" => "127.0.0.1", 7 "Port" => "119" 8 ) 9 puts "Logged in" 10 putss.cmd("group comp.lang.ruby") thufir@dur:~/ruby/ssh$ thufir@dur:~/ruby/ssh$ In fact, it doesn't even seem to be "logging in" since that put never executes. Am I using the right API? If so, how do I get the response which "telnet localhost nntp" brings up in the terminal? thanks, Thufir