0

I'm trying to set up an ASCII Art Telnet Server like the classic ASCII Star Wars Project:

telnet towel.blinkenlights.nl

https://github.com/nitram509/ascii-telnet-server

I've had success at setting up a telnet server, but I'm missing the last step of making the asciiplayer run upon telnetting in. (Ideally, I'd like it to work like towel.blinkenlights.nl, where you don't have to log in and the ASCII Movie immediately starts.)

SETTING UP TELNET

Here are the steps I've followed using a fresh Digital Ocean droplet running Ubuntu 16.04.2 x64 after setting up a firewall and opening port 23.

install telnetd and xinetd: sudo apt-get install xinetd telnetd

create telnet file in /etc/xinetd.d: sudo nano /etc/xinetd.d/telnet

# default: on
# description: The telnet server serves telnet sessions; it uses
# unencrypted username/password pairs for authentication.
service telnet
{
        disable = no
        flags = REUSE
        socket_type = stream
        wait = no
        user = root
        server = /usr/sbin/in.telnetd
        log_on_failure += USERID
}

Restart xinetd service: sudo service xinetd restart

GETTING THE ASCIIPLAYER WORKING

I've confirmed that this allows telnet access (using a username/password)

I uploaded the asciiplayer folder to /opt/

According to the README for asciiplayer, I need to replace the above configuration into /etc/xinetd.d/telnet with the bit below:

# default: on
# description: An telnet service playing an ASCII movie
service telnet
{
        disable         = no
        socket_type     = stream
        protocol        = tcp
        port            = 23
        user            = root
        wait            = no
        instances       = 10

        log_type        = FILE /var/log/asciiplayer
        log_on_success  += PID HOST DURATION
        log_on_failure  = HOST
        server          = /usr/bin/python
        server_args     = -u -OO /opt/asciiplayer/ascii_telnet_server.py -f /opt/asciiplayer/sw1.txt --stdout
}

After doing so, I can no longer telnet into the server. It simply returns:

telnet: Unable to connect to remote host: Connection refused

What part of the process am I missing? I feel like it's very close. I've done the above process a few times and simply can't get the ascii_telnet_server.py to run upon telnetting. The world needs more ASCII movies over telnet!! Any help would be greatly appreciated...

3
  • Is the path correct (did you actuall install ascii_telnet_server.py in /opt)? Have you tried running /opt/asciiplayer/ascii_telnet_server.py -f /opt/asciiplayer/sw1.txt --stdout directly as root?
    – dirkt
    Jun 19, 2017 at 9:28
  • Good idea @dirkt, I updated the question... Looks like it was maybe a python path issue... python /opt/asciiplayer/ascii_telnet_server.py -f /opt/asciiplayer/sw1.txt --stdout now works! when logged in as root. I'm now going to fiddle with getting it to run when someone telnets to the box (hopefully with no user/password, just like the classic jam).
    – jon.s
    Jun 19, 2017 at 16:07
  • Please add an answer and describe exactly what you did.
    – dirkt
    Jun 19, 2017 at 16:10

1 Answer 1

0

Thnx to @dirkt's comment/hint/help, I was able to hunt down the simple solution.

Running /opt/asciiplayer/ascii_telnet_server.py -f /opt/asciiplayer/sw1.txt --stdout directly as root returned the following error:

/opt/asciiplayer/ascii_telnet_server.py: line 43: 

: No such file or directory
from: can't read /var/mail/__future__
/opt/asciiplayer/ascii_telnet_server.py: line 46: import: command not found
/opt/asciiplayer/ascii_telnet_server.py: line 47: import: command not found
from: can't read /var/mail/optparse
from: can't read /var/mail/ascii_telnet.ascii_movie
from: can't read /var/mail/ascii_telnet.ascii_player
from: can't read /var/mail/ascii_telnet.ascii_server
/opt/asciiplayer/ascii_telnet_server.py: line 55: syntax error near unexpected token `('
/opt/asciiplayer/ascii_telnet_server.py: line 55: `def runTcpServer(interface, port, filename):'

Which looked like the problem was a simple Python path issue... So, I replaced # !/usr/bin/env python in opt/asciiplayer/ascii_telnet_server.py with # !/usr/bin/python (which is the path that which python gave me)

For your ASCII pleasure, try: telnet 138.197.212.250 (IP subject to change as I continue to dev)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .