MihanServer.IR

مرکز آموزش

How To Prevent SSH Root Access

While this is a well know security measure, I still see so many Linux servers that allow root login through SSH that I thought I’d post it here.

Before you make change to your Linux box, make sure that you’ve got a normal user account created otherwise you’ll lock yourself out unless you’ve got physical access to your server. Here’s how you can add a user account through command lines:

# adduser newusername
# passwd newusername


To prevent SSH root login on CentOS 5.1 / RHEL 5, edit /etc/ssh/sshd_config with your favorite file editor:

# vi /etc/ssh/sshd_config

And find the line that contains:

#PermitRootLogin yes

Uncomment the parameter and set its value to ‘no’:

PermitRootLogin no

Now save the change and exit the editor. Restart sshd service to apply the change.

# service sshd restart

From now on you will not be able to login as root first. You will have to login as a normal user and then become root by issuing:

# su – root



آیا این پاسخ به شما کمک کرد؟

افزودن به مورد علاقه ها افزودن به مورد علاقه ها

چاپ این مقاله چاپ این مقاله

خوانده شده
How to install ffmpeg (مشاهدات: 233)
Howto Upgrade perl (مشاهدات: 139)

Powered by WHMCompleteSolution

زبان:

منوی سریع

ورود کاربر

ایمیل

کلمه عبور

مرا به خاطر بسپار

جستجو



پیگیری ما در توییتر