Following the API at:
http://rubydoc.info/gems/net-ssh-telnet/0.0.2/frames
I want to login to leafnode with something like:
s = Net::SSH::Telnet.new(:host => localhost,:port => 119)
here's what I have so far, though:
thufir@dur:~/ruby/telnet$
thufir@dur:~/ruby/telnet$ ruby telnet.rb
hello
telnet.rb:8:in `<main>': uninitialized constant Net::SSH::Telnet
(NameError)
thufir@dur:~/ruby/telnet$
thufir@dur:~/ruby/telnet$ nl telnet.rb
1 require "rubygems"
2 require "net/ssh"
3 puts "hello"
4 s = Net::SSH::Telnet.new(
5 "Dump_log" => "/dev/stdout",
6 "Host" => "127.0.0.1:119",
7 )
8 puts "Logged in"
9 puts s.cmd("echo hello")
10 put "started"
thufir@dur:~/ruby/telnet$
thufir@dur:~/ruby/telnet$ telnet localhost nntp
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
200 Leafnode NNTP Daemon, version 1.11.8 running at localhost (my fqdn:
dur.bounceme.net)
quit
205 Always happy to serve!
Connection closed by foreign host.
thufir@dur:~/ruby/telnet$
thufir@dur:~/ruby/telnet$ telnet localhost 119
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
200 Leafnode NNTP Daemon, version 1.11.8 running at localhost (my fqdn:
dur.bounceme.net)
quit
205 Always happy to serve!
Connection closed by foreign host.
thufir@dur:~/ruby/telnet$
I've tried various ways of setting the port, but can't figure it out.
How do you set the port?
thanks,
Thufir