Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

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 :)

share|improve this question
    
Schedule regular comprehensive backups and test restoring from them! It's the last line of defense, and pretty vital at that. –  Deer Hunter Mar 26 '13 at 8:39
add comment

1 Answer

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.

share|improve this answer
    
"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 '13 at 14:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.