{"id":200,"date":"2010-12-26T01:40:48","date_gmt":"2010-12-26T00:40:48","guid":{"rendered":"http:\/\/lunatic.no\/?p=200"},"modified":"2010-12-26T01:40:48","modified_gmt":"2010-12-26T00:40:48","slug":"mac-address-based-telnet-server-in-linux","status":"publish","type":"post","link":"http:\/\/130.61.186.249\/index.php\/2010\/12\/26\/mac-address-based-telnet-server-in-linux\/","title":{"rendered":"MAC-address based Telnet server in Linux"},"content":{"rendered":"<p>My previous post was about <a title=\"Permanent Link to RouterOS Mac-Telnet application for Linux users\" rel=\"bookmark\" href=\"\/2010\/10\/routeros-mac-telnet-application-for-linux-users\/\">RouterOS Mac-Telnet application for Linux users<\/a> where I talked about the MAC-Telnet client I created for Linux users.<br \/>\nSince then, I have both started porting it to OS X and to create a daemon version of MAC-Telnet, called &#8220;mactelnetd&#8221;. You can look at the different branches at <a title=\"MAC-Telnet at github.com\" href=\"http:\/\/github.com\/haakonnessjoen\/MAC-Telnet\" target=\"_blank\" rel=\"noopener\">github.com<\/a>.<br \/>\nTo use mactelnetd, install MAC-Telnet from the github link, using either the latest .deb file from the download section (if you are on Ubuntu or Debian), or download the sources and compile it yourself. You can find instructions for this on my previous post. you first need to edit the \/etc\/mactelnetd.users file. This file consists of the users and their respective passwords for logging into the server. I wish we wouldn&#8217;t have to write the passwords in plain text, but the authentication method used in the mac-telnet protocol demands that we know the actual password, unlike ssh\/regular telnet, where the password can be stored as a hash sum.<br \/>\nThe format of \/etc\/mactelnetd.users is like this:<\/p>\n<pre escaped=\"true\" lang=\"bash\" line=\"0\"># Users file for MAC-Telnetd\n# Use existing usernames from your system\n#\n# Format:\n#username:password\nhaakon:mypass<\/pre>\n<p>Here I have activated the user account haakon, with apssword &#8220;mypass&#8221;. It is important that the user names that you enter into this file is existing user names from your Linux machine. The mactelnetd daemon will check \/etc\/passwd for home directory, and what shell to spawn for the user, as any regular terminal server.<br \/>\nWhen you have created\/modified this file to your wishes, you can start the server daemon:<\/p>\n<pre escaped=\"true\" lang=\"bash\" line=\"0\">$ sudo mactelnetd<\/pre>\n<p>If there were no error messages, it spawned successfully and you can watch it&#8217;s log entries via syslog.<\/p>\n<pre escaped=\"true\" lang=\"bash\" line=\"0\">$ tail -f \/var\/log\/syslog\nDec 26 01:06:08 haakon-kontorpc mactelnetd[10183]: Bound to 0.0.0.0:20561\nDec 26 01:31:17 haakon-kontorpc mactelnetd[10183]: (28780) New connection from 0:c:42:3e:20:c2.\nDec 26 01:31:17 haakon-kontorpc mactelnetd[10391]: (28780) User haakon logged in.\n<\/pre>\n<p>Here you see the results of me logging into my Linux Desktop machine from a MikroTik Router using the RouterOS command &#8220;tool mac-telnet 1c:6f:65:2c:98:b7&#8221;<\/p>\n<pre escaped=\"true\" lang=\"bash\" line=\"0\">[admin@Holmenveien] &gt; tool mac-telnet 1c:6f:65:2c:98:b7\nLogin: haakon\nPassword:\nTrying 1C:6F:65:2C:98:B7...\nConnected to 1C:6F:65:2C:98:B7\nLinux haakon-kontorpc 2.6.35-23-generic-pae #41-Ubuntu SMP Wed Nov 24 10:35:46 UTC 2010 i686 GNU\/Linux\nUbuntu 10.10\nWelcome to Ubuntu!\n* Documentation:  https:\/\/help.ubuntu.com\/\nhaakon@haakon-kontorpc:~$ w\n01:32:52 up 24 days, 22:48,  2 users,  load average: 0.53, 0.61, 0.57\nUSER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT\nhaakon   tty7     :0               01Dec10 24days 26:29m  3.17s gnome-session\nhaakon   pts\/0    0:c:42:3e:20:c2  01:32    0.00s  0.15s  0.00s w<\/pre>\n<p>If you want to shut down the mactelnetd server, simply write &#8220;sudo killall mactelnetd&#8221; in your shell.<br \/>\n<strong>FUN TIP:<\/strong> If you want &#8220;fancy&#8221; terminal promt like RouterOS has, with syntax coloring on your Linux machine (logging in via console, xterm, ssh or mactelnet), you can install the shell &#8220;<a title=\"Friendly Interactive SHell\" href=\"http:\/\/en.wikipedia.org\/wiki\/Friendly_interactive_shell\" target=\"_blank\" rel=\"noopener\">fish<\/a>&#8220;, and then change your user settings to use it as the default shell by issuing:<\/p>\n<pre escaped=\"true\" lang=\"bash\" line=\"0\">$ sudo usermod --shell \/usr\/bin\/fish myusername<\/pre>\n<p><strong>NB:<\/strong> Be sure that the file \/usr\/bin\/fish exists, and change &#8220;myusername&#8221; with your username, and remember to test logging into a second console, just to be sure you did this correctly, before logging out of your current terminal. To revert, set \/bin\/bash as your shell again, or what ever shell you previously used.<br \/>\nHere&#8217;s a direct link to the latest Ubuntu\/Debian package at the time of writing:<br \/>\n<a href=\"https:\/\/github.com\/downloads\/haakonnessjoen\/MAC-Telnet\/mactelnet_0.2-1ubuntu1_i386.deb\">mactelnet_0.2-1ubuntu1_i386.deb<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>My previous post was about RouterOS Mac-Telnet application for Linux users where I talked about the MAC-Telnet client I created for Linux users. Since then, I have both started porting it to OS X and to create a daemon version of MAC-Telnet, called &#8220;mactelnetd&#8221;. You can look at the different branches at github.com. To use [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,22,27],"tags":[],"class_list":["post-200","post","type-post","status-publish","format-standard","hentry","category-cprogramming","category-mikrotik","category-routeros"],"_links":{"self":[{"href":"http:\/\/130.61.186.249\/index.php\/wp-json\/wp\/v2\/posts\/200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/130.61.186.249\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/130.61.186.249\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/130.61.186.249\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/130.61.186.249\/index.php\/wp-json\/wp\/v2\/comments?post=200"}],"version-history":[{"count":0,"href":"http:\/\/130.61.186.249\/index.php\/wp-json\/wp\/v2\/posts\/200\/revisions"}],"wp:attachment":[{"href":"http:\/\/130.61.186.249\/index.php\/wp-json\/wp\/v2\/media?parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/130.61.186.249\/index.php\/wp-json\/wp\/v2\/categories?post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/130.61.186.249\/index.php\/wp-json\/wp\/v2\/tags?post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}