How to Secure Your Masternode!

First, choose any other port than 22, this will prevent hacking bots, which continually attack port 22 but you can choose any port you want, any number between 0 to 65535.  So, choose a number between 0 and 65535, for this example, I am going to use port 99.

First, type the following and add port  tcp to your firewall:

system-config-firewall-tui

Next, edit the ssh config file by typing:

vi /etc/ssh/sshd_config

Change the following line:

# Port 22
to:
Port 99

Next type:

service sshd restart

to restart SSH.  Next time you login, make sure to CHANGE PORT from 22 to the port you changed it to!

Next, MAKE SURE YOU HAVE A SECURE PASSWORD, if you do not, you can easily change your password by typing:
passwd

Try using a site like passwordsgenerator.net.

Next, let’s put a brute force script to ban anyone trying to brute force attack your password, it will ban any IPs for 10 hours if they enter the wrong password 3 times in a row:

yum -y install epel-release;yum -y install fail2ban;systemctl enable fail2ban;cd /etc/fail2ban/;wget http://highoncoins.com/jail.local;systemctl restart fail2ban

After that type:
fail2ban-client status

The current values will ban any brute force attacks but if you want to change the parameters, you can change it here:
/etc/fail2ban/jail.local
You can use Nano or Vi to edit the file.

Now, this tutorial has been made for noobs and beginners. If you are an expert, I do recommend using SSH keys which are more secure but with strong password and brute force script, you should be fine.

More info on Fail2ban here.

Above is for CentOS6, for CentOS7, see:

yum -y install epel-release;yum -y install fail2ban;chkconfig fail2ban on;cd /etc/fail2ban/;wget http://highoncoins.com/jail.local;service fail2ban start

6 Comments

  1. How do I take my profits out of my masternode max? I want to help on the buy walls and I need this profits bc I already have 3 mn’s

  2. Hello, I’ve been trying to set up masternode and had no success., got all the way down to
    [root@vultr .chaincoin]# chaincoind –daemon
    Chaincoin server starting
    then I’ve been getting this
    [root@vultr .chaincoin]# chaincoind get info
    error: couldn’t connect to server
    Can anyone help, I’m trying to set up a couple of masternodes.

    Thanks

  3. Max you da man brother, it took me a while but I finally got my masternode running.
    Thank you so much for all the help, you give all of us newbies hope, made it really simple to follow directions and and helping us build our CHC Club.
    Hodl

  4. Hi Max! Thanks for yuor tutorials! Would be great if you post some basic commands for masternode on CentOS. Such us – check status, send money out, stop and restart masternode and etc. Thanks!

  5. How do you get the coins out!

  6. Hey Max

    Well I screwed up changing the port number. Now I have the firewall port number as —- and the log in is 22……. help. When I try to log in I get ssh: connect to host 45.33.41.45 port 22: Connection refused
    NaCl plugin exited with status code 255.
    (R)econnect, (C)hoose another connection, or E(x)it?
    failed! 🙁 I also get the same message when I use the firewall port number.

Leave a Reply

Your email address will not be published.

*