Skip to content

Commit

Permalink
changed to listen on a different port number so that it doesnt have t…
Browse files Browse the repository at this point in the history
…o be run as root, which was a security risk
  • Loading branch information
Frimkron committed May 15, 2017
1 parent 7f689aa commit 8a51ea4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 8 additions & 10 deletions README.md
Expand Up @@ -18,7 +18,7 @@ to the internet.

To connect to the server you will need a telnet client. On Mac, Linux, and
versions of Windows prior to Windows Vista, the telnet client is usually
installed by default. For Windows Vista, 7, or 8, you may need to follow
installed by default. For Windows Vista, 7, 8 or later, you may need to follow
[this guide](http://technet.microsoft.com/en-us/library/cc771275%28v=ws.10%29.aspx)
to install it.

Expand All @@ -36,11 +36,8 @@ interpreter. To stop the server, simply close the terminal window.

From the terminal, change to the directory containing the script and run

sudo python simplemud.py
python simplemud.py

The script must be run as root in order to have permission to listen on
port 23.

Note, if you are connected to the machine via SSH, you will find that the
script stops running when you quit the SSH session. A simple way to leave the
script running is to use a tool called `screen`. Connect via SSH as usual then
Expand All @@ -56,7 +53,7 @@ Connecting to the Server
------------------------

If the server is running behind a NAT such as a home router, you will need to
set up port 23 to be forwarded to the machine running the server. See your
set up port **1234** to be forwarded to the machine running the server. See your
router's instructions for how to set this up. There are a large number of
setup guides for different models of router here:
<http://portforward.com/english/routers/port_forwarding/>
Expand All @@ -68,17 +65,18 @@ that machine.
To connect to the server, open your operating system's terminal or command
prompt and start the telnet client by running:

telnet <ip address>
telnet <ip address> 1234

where `<ip address>` is the external IP address of the server, as described
above.
above. 1234 is the port number that the server listens on.

If you are using Windows Vista, 7, or 8 and get the message:
If you are using Windows Vista, 7, 8 or later and get the message:

'telnet' is not recognized as an internal or external command, operable
program or batch file.

then follow [this guide](http://technet.microsoft.com/en-us/library/cc771275%28v=ws.10%29.aspx)
then follow
[this guide](http://technet.microsoft.com/en-us/library/cc771275%28v=ws.10%29.aspx)
to install the Windows telnet client.

If all goes well, you should be presented with the message
Expand Down
8 changes: 5 additions & 3 deletions mudserver.py
Expand Up @@ -98,9 +98,11 @@ def __init__(self):
1)

# bind the socket to an ip address and port. Port 23 is the standard
# telnet port which telnet clients will use. Address 0.0.0.0 means that
# we will bind to all of the available network interfaces
self._listen_socket.bind(("0.0.0.0", 23))
# telnet port which telnet clients will use, however on some platforms
# this requires root permissions, so we use a higher arbitrary port
# number instead: 1234. Address 0.0.0.0 means that we will bind to all
# of the available network interfaces
self._listen_socket.bind(("0.0.0.0", 1234))

# set to non-blocking mode. This means that when we call 'accept', it
# will return immediately without waiting for a connection
Expand Down

0 comments on commit 8a51ea4

Please sign in to comment.