Jump to content

What is this? CentOS


Vag

Recommended Posts

3502c1c9a3a6326ec6a007d03241907f.png

 

Yeah.. 235,030 failed login attempts :/

 

Someone is trying to bruteforce you

use the folowing commands to install fail2ban on your VPS

 

yum install fail2ban -y
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
service fail2ban restart
Link to comment
Share on other sites

You're being bruteforced.

What you should do: (any or all of these will help)

  • Change your SSH port
  • Require a keypair on SSH login
  • Disable your "root" user

 

Changing your SSH port

Run this command: vi /etc/ssh/sshd_config

Your screen should come up with the default sshd configuration.

Press a and then press enter, and type "Port <THE PORT YOU WANT TO RUN ON>"

Press esc, then :x. This will save the file and exit vim.

Remember the port you chose; you need this to connect via SSH.

Type service sshd restart and then close the PuTTY tab. Change the port to the new port and connect.

 

Keypairs via SSH

This is not recommended unless you know what you're doing. Tutorial here.

 

Disabling your "root" user

First, create a new user. Type useradd <YOUR SPECIFIED USERNAME>

Then type passwd <YOUR SPECIFIED USERNAME> and type your desired password twice (for confirmation)

Now, type visudo and scroll down to the line that says # User privilege specification (use down arrow to scroll down)

Look for the line that says root ALL=(ALL) ALL. Below that line, type <YOUR SPECIFIED USERNAME> ALL=(ALL) ALL and exit.

Now, we will disable the root user.

Type vi /etc/ssh/sshd_config and press a and then type "PermitRootLogin no" then press esc and then :x.

Type service sshd restart to complete this.

 

Good luck!

Edited by Bobrocket
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...