I have just setup an ubuntu web server to use at home as a backup and development server for a website i have. I am using dyndns so my colleges can access this also and test new code.

This works well but im worried about security. This has only been open to the world for 24 hours and already had hack attempts from 4 different ip addresses. (korea and hong kong)

  • hack attempts being trying to login over ssh with usernames such as root, oracle, smbuser

How can i secure this server more so i can feel at ease?

FYI, the data is not highly confidential so not the end of the world if anyone gets in, but obviously don't want people playing around with it.


Update, i did add my public ssh key to the server to login but after a restart went back to normal


Disable password based authentication and change SSH port to something else, would probably keep you relatively safe against brute-force attacks. (that's done through sshd config file).

Additionally if you know IPs of folks who need to access your home server you can tweak iptables to only allow connections from those IPs.

| improve this answer | |

Also disable root access via ssh, and enable MaxTries.

Visit http://www.howtogeek.com/howto/linux/security-tip-disable-root-ssh-login-on-linux/ for more information on it.

| improve this answer | |
  • Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Peachy Nov 7 '12 at 4:00

In addtion to disabling password-based authentication, try this:

sudo apt-get install denyhosts

It does wonders. Moreover, if you are using keys to log in, your own failed attempts to guess the passphrase won't count, so this way you won't run the risk of locking yourself out of your machine.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy