Jump to content

What is this? CentOS


Recommended Posts

Posted (edited)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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