![]() |
|
How to Secure a Server / VPS | Beginner Friendly - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Computing (https://hackforums.net/forumdisplay.php?fid=88) +---- Forum: Linux (https://hackforums.net/forumdisplay.php?fid=85) +---- Thread: How to Secure a Server / VPS | Beginner Friendly (/showthread.php?tid=5189229) Pages: Pages
1
2
|
How to Secure a Server / VPS | Beginner Friendly - Cryptic™ - Mar 1, 2016 ![]() Most people that buy VPSs here have little to no knowledge of basic server security. Here are some good things you should do to your server as soon as you get it. This guide will give tell you about the things I do when I get my first get my servers. Note: This thread is based on the Centos 6 operating system, if you use Centos 7 or another variant of Linux like Ubuntu / Debian some commands may be slightly different. Like in centos we use yum whereas in Debian/Ubuntu you would use apt-get I will try my best to include commands for both.
* - BooGod - Mar 1, 2016 Nice guide, I knew you would do something good from it. * - Cryptic™ - Mar 1, 2016 (Mar 1, 2016 04:54 PM)BooGod Wrote: Nice guide, I knew you would do something good from it. After I saw how insecure Elfonzo's server's were. I searched if there were any decent server security guides on HF, and there weren't any. So I figured I'd write one up. * - Cryptic™ - Mar 1, 2016 Updated the guide with a tip on locking the root account. Only run passwd -l root if you added your other account to the sudoers file by running visudo as shown in Step 4. Or else you'll be permanently locked out of your server and will need a reinstall. * - AdderallXR - Mar 1, 2016 thanks for this going try it out now <3 * - ๖ۣۜCitizen Z / Napalm - Mar 2, 2016 (Mar 1, 2016 04:57 PM)Cryptic™ Wrote: After I saw how insecure Elfonzo's server's were. I searched if there were any decent server security guides on HF, and there weren't any. Whats really funny is that i linked it to Elfonzo because i was helping him with something. * - BooGod - Mar 2, 2016 (Mar 1, 2016 04:57 PM)Cryptic™ Wrote: After I saw how insecure Elfonzo's server's were. I searched if there were any decent server security guides on HF, and there weren't any. I know, that's what I am talking about his ProtonPay.com site. * - Raaz - Mar 2, 2016 Nice guide mate, waiting for the more advance version. * - Freebooter - Mar 2, 2016 Nice one Cryptic™ very nice tutorial if i can i will give you +3 rep hold on i can do this i'm on it! * - Emoticon - Mar 2, 2016 And if you want to be even more of a perfectionist, have openssh listen on 127.0.0.1 only and connect through a tor hidden service exclusively That's what I do with things I give a shit about. Other than that I just set user:pass to root:fuck * - Doctor Blue - Mar 3, 2016 I have my servers configured to require double authentication if I'm not at home. If I'm at home, I just need my SSH key, otherwise I also have to plug in my Yubikey. Some other good points to include is drop-by-default firewall rules, making sure services like MySQL only listen on loopback, only allowing SFTP or FTPS and maybe in the long run, how to use SELinux. I have most of this configuration in a bash script, so when I get a new server I just run it and it will save my public keys, fix up the firewall rules and add a cron to update software automatically. I don't personally use fail2ban because good luck bruteforcing a combination of 4096 bit keys along with a one time password. I do use it on my mail server, though. "If you get root of a server, your like the god of the server." You're* EDIT: Yes I'm a bit paranoid. * - blusmurf - Mar 3, 2016 1.Disable any unused service. Especially old service like xinetd. 2.Use iptables or ufw to restrict listening port. Only open necessary ports and know your running services. 3. Do not use FTP. Use SFTP instead. 4. This may be obscurity over security = Change SSH listening port from 22 to another port (example: 2222) - But it won't survive portscan/nmap though, it's just you can defeat first wave of attack from script kiddies. 5. Install Intrusion Detecting System like Tripwire may help. * - ra1d - Mar 3, 2016 Awesome guide, I personally use almost all of those security measures. Only recently started messing around with linux servers. * - wander is a multi dwc - Mar 3, 2016 I'd say that changing the SSH port is a fundamental step in securing a server. Along with that, it would be helpful to some users if you could explain a bit more about how sudo works. Also, found an error. In the last part, it's /etc/ssh/sshd_config, not etc/ssh/sshd_config * - Cryptic™ - Mar 4, 2016 (Mar 3, 2016 11:51 PM)Queenie Wrote: I'd say that changing the SSH port is a fundamental step in securing a server. You can change the lock on the door, but the door can still be broken into if your lock lacks reinforcement. Changing SSH port will mitigate some attacks, meaning most bots that will try to get into your box will give up, but if someone was serious about it they could always run a port scan and then find your SSH port. |