{"id":424,"date":"2009-09-18T16:16:32","date_gmt":"2009-09-18T08:16:32","guid":{"rendered":"http:\/\/www.tzlee.com\/blog\/?p=424"},"modified":"2009-10-14T03:42:04","modified_gmt":"2009-10-13T19:42:04","slug":"telnet-to-serial-script-for-the-mac-now-complete","status":"publish","type":"post","link":"https:\/\/tzlee.com\/blog\/2009\/09\/telnet-to-serial-script-for-the-mac-now-complete\/","title":{"rendered":"Telnet to Serial Script for the Mac, Now Complete"},"content":{"rendered":"<p>In my <a href=\"http:\/\/www.tzlee.com\/blog\/?p=412\">previous blog entry<\/a>, I found a tool MultiCom that proxies my serial to a TCP socket, but it was lacking the ability to set my telnet client into character mode and wasn&#8217;t working with Cisco devices.<\/p>\n<p>I later found out this was because Telent sends CR + NULL everytime you hit ENTER, so this happens:<\/p>\n<blockquote>\n<pre>Username: (type username) CR\r\nPassword: NULL (type password)<\/pre>\n<\/blockquote>\n<p>I couldn&#8217;t log in! I am curious why other devices ignored the NULL while Cisco choose to process it. Not as if NULL would be used as part of a password.<\/p>\n<p>So, I got my script to work. Theoretically this script should work on any UNIX system and on any type of FIFO, but I&#8217;ve only had time to test it on the Mac and a serial cable.<\/p>\n<p>Download the script <a href=\"http:\/\/www.tzlee.com\/downloads\/public\/serial.py.txt\">here<\/a>. Rename it to <code>script.py<\/code> and then <code>chmod 755 script.py<\/code>.<\/p>\n<p><!--more-->Here&#8217;s how to use it.<\/p>\n<p>Start the script in one terminal window. <code>\/dev\/cu.PL2303-0000101D<\/code> is your serial device. You may choose to run it in the background by suffixing a &#8220;&amp;&#8221; after the command.<\/p>\n<blockquote>\n<pre><strong>$ .\/serial.py \/dev\/cu.PL2303-0000101D<\/strong>\r\nSerial to Telnet Proxy  Copyright (C) 2009  Justin Lee\r\nThis program comes with ABSOLUTELY NO WARRANTY. This is free software, and you\r\nare welcome to redistribute it under certain conditions. For details, see the\r\nfull license at http:\/\/www.gnu.org\/licenses\/gpl-3.0.html\r\n\r\nListening on 127.0.0.1:2300.<\/pre>\n<\/blockquote>\n<p>Once it&#8217;s ready, it will listen on port 2300 (the default). Open another window and telnet to this port on your localhost.<\/p>\n<blockquote>\n<pre><strong>$ telnet localhost 2300<\/strong>\r\nTrying 127.0.0.1...\r\nConnected to localhost.\r\nEscape character is '^]'.\r\n\r\nUser Access Verification\r\n\r\nUsername: cisco\r\nPassword: \r\n\r\nlab&gt;?\r\nExec commands:\r\n  access-enable    Create a temporary Access-List entry\r\n  clear            Reset functions\r\n  connect          Open a terminal connection\r\n  disable          Turn off privileged commands\r\n  disconnect       Disconnect an existing network connection\r\n  enable           Turn on privileged commands<\/pre>\n<\/blockquote>\n<p>I&#8217;ve tested it with a Cisco switch and some other appliances and they work OK. Let me know if you encounter any bugs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my previous blog entry, I found a tool MultiCom that proxies my serial to a TCP socket, but it was lacking the ability to set my telnet client into character mode and wasn&#8217;t working with Cisco devices. I later&#8230; <a class=\"more-link\" href=\"https:\/\/tzlee.com\/blog\/2009\/09\/telnet-to-serial-script-for-the-mac-now-complete\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8],"tags":[47,76,74,75,77],"class_list":["post-424","post","type-post","status-publish","format-standard","hentry","category-tech","tag-cisco","tag-console","tag-mac","tag-serial","tag-telnet"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts\/424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/comments?post=424"}],"version-history":[{"count":17,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":602,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts\/424\/revisions\/602"}],"wp:attachment":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/tags?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}