1

I'm going to purchase my own dedicated server service soon and run few python server scripts on it.

Firstly, let me tell you that I am total noob when it comes to internet security and was unable to find answers to my questions using google.

I want to have few python servers, listening on different ports and providing me with different services. For example one of them will poll few websites to get their content and update data on the server. Then I will connect to it and grab the most recent data. Communication between server and client will be in JSON format. I would want to enable file downloading as well. Probably using SFTP to secure whole process.

So my questions are:

  1. How can I implement secure connection between client and my python server? I guess I could use SSH or SSL, but which one will be better suited for the job? And If I choose SSH then wouldn't it interfere with SSH login service I use to manage my (whole) server?

  2. Is opening multiple ports very insecure? What kind of attacks could it bring on me? How can I prevent them?

  3. Do you have any other tips regarding own server implementation?

As I'm totally new to this stuff please tell me if you see any gaps in my logic :)

1
  • Schedule regular comprehensive backups and test restoring from them! It's the last line of defense, and pretty vital at that. Mar 26, 2013 at 8:39

1 Answer 1

3

How can I implement secure connection between client and my python server? I guess I could use SSH or SSL, but which one will be better suited for the job? And If I choose SSH then wouldn't it interfere with SSH login service I use to manage my (whole) server?

If it is only you that will be connecting to the server, I would secure the whole process using a VPN.

Is opening multiple ports very insecure? What kind of attacks could it bring on me? How can I prevent them?

The ports are only as secure as the services listening on them. Opening multiple unneeded ports serve to increase the attack surface of your server, as there are many more points of failure possible. Disable all unused services on your server.

Do you have any other tips regarding own server implementation?

Keep your server up to date. This involves running a command like sudo apt-get update && sudo apt-get dist-upgrade on Ubuntu-like distros or yum update on RHEL-based distros.

Have proper iptable rules configured. See this link for a good baseline. Configure as necessary.

Configure ssh to use key-based authentication instead of passwords. This helps to increase the difficulty of bruteforce attacks against the ssh service. Disable root login using ssh.

1
  • "The ports are only as secure as the services listening on them" - so using my example with sending and receiving JSON packets via secure connection (SSH/SSL) using twisted library to create server, what kind of attacks am I susceptible to? Also I would want to have several other services running on the server ( Mail,SVN,ownCloud). Can I run them on root? Or should I create another account to host them?
    – k_R
    Mar 26, 2013 at 14:12

You must log in to answer this question.

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