Disable Direct Root Login.
This will force you to login as another user in (in cpanel the user must be in the wheel group), and then su to root. This helps to protect the server from 'wanna-be' hackers.
If you're using cPanel make sure you add a new user to the 'wheel' group so that you will be able to 'su -' to root, otherwise you may lock yourself out of root.
Set up anotheruser if you haven't already got one:
1. Type: groupadd newuser
2. Type: useradd newuserr -gnewuser
3. Type: passwd newuser passwordhere
On a CPanel system, you must add the new user to the wheel group via WHM "Manage Wheel Group Users".
After you have done this, you will have to login as newuser and then you will do 'su - root' to get to root.
Now copy and paste the following line to edit the necessary file for SSH logins
pico -w /etc/ssh/sshd_config
You should now be in the actual file - find the line
Protocol 2, 1
Uncomment this line and change it to look like this:
Protocol 2
As the next step find the line
PermitRootLogin yes
Uncomment that line and make it look like
PermitRootLogin no
Save and exit the file with Ctrl+X and then Y then enter
Now restart SSH
/etc/rc.d/init.d/sshd restart
From now on nobody will be able to login directly as root. To gain root access you will need to login as a different user and then switch to root.
--------
سلام. دوستان.
من یوزر رو تو Manage Wheel Group Users اضافه کردم. منتها نمیدونم پسوردش چیه ؟
فکر می کنم به اینها مرتبط بشه که نمیدونم کجا باید انجام بدم:
1. Type: groupadd newuser
2. Type: useradd newuserr -gnewuser
3. Type: passwd newuser passwordhere
ممنون میشم راهنمایی کنید.