نحوه نصب SELinux در سرور اوبونتو 20.04

گره منبع: 1858308

If you’ve already spent the time learning SELinux, but have to deploy Ubuntu as a server operating system, you can install SELinux and be on familiar ground. Jack Wallen shows you how.

password.jpg

تصویر: GettyImages/Yuichiro Chino

مرکز داده باید خوانده شود

Ubuntu Server has its own Mandatory Access Control system, called AppArmor, which is similar to SELinux, in that they both provide tools to isolate applications from one another, to protect the host system. But how each of these tools is used is quite different. In fact, just because you know one, doesn’t mean you’ll be able to immediately use the other. That’s why you might want to consider installing SELinux on Ubuntu Server. You might be migrating from a Red Hat-based distribution and have invested considerable time learning how to use that particular system.

خوب است که می توانید SELinux را در اوبونتو نصب کنید. 

In fact, it’s actually quite simple, and I’m going to show you how it’s done. Once finished, you can start working with SELinux on Ubuntu Server in the same way you did when administering your Red Hat-based systems.

آنچه شما نیاز دارید

To make this work, you’ll need a running instance of Ubuntu Server 20.04 and a user with sudo privileges. That’s it. Let’s get to work.

One warning: I highly recommend you first try this on a test system. And once you’re certain it will work for you, I would recommend you install SELinux on a fresh install of Ubuntu Server and then build from there.

نحوه حذف AppArmor

اولین کاری که باید انجام دهید حذف AppArmor است. وارد سرور اوبونتو شوید و با دستور زیر سرویس را متوقف کنید:

sudo systemctl stop apparmor

اکنون می توانیم AppArmor را با دستور حذف کنیم:

sudo apt-get remove apparmor -y

پس از حذف AppArmor، سیستم خود را با استفاده از:

راه اندازی مجدد sudo

نحوه نصب SELinux

اکنون می توانیم SELinux را نصب کنیم. به پنجره ترمینال برگردید، دستور را صادر کنید:

sudo apt-get install policycoreutils selinux-utils selinux-basics -y

پس از اتمام نصب، SELinux را با دستور زیر فعال کنید:

sudo selinux-activate

SELinux را روی حالت اجباری تنظیم کنید:

sudo selinux-config-enforcing

در نهایت سیستم خود را یکبار دیگر راه اندازی مجدد کنید:

راه اندازی مجدد sudo

هنگامی که سیستم دوباره بالا آمد، بررسی کنید تا مطمئن شوید SELinux با دستور فعال است:

ساتاوات

شما باید چیزی شبیه به:

وضعیت SELinux: فعال است
نصب SELinuxfs: /sys/fs/selinux
دایرکتوری ریشه SELinux: /etc/selinux
نام خط مشی بارگذاری شده: پیش فرض
حالت فعلی: مجاز
حالت از فایل پیکربندی: اجرا
وضعیت سیاست MLS: فعال است
خط مشی deny_unknown status: مجاز است
بررسی حفاظت از حافظه: درخواستی (ناامن)
نسخه سیاست هسته حداکثر: 31

And that’s all there is to install SELinux on Ubuntu Server 20.04. If you’re already familiar with this security system, you can jump in and start securing your server.

همچنین مشاهده کنید

Source: https://www.techrepublic.com/article/how-to-install-selinux-on-ubuntu-server-20-04/#ftag=RSS56d97e7

تمبر زمان:

بیشتر از توسعه دهنده در TechRepublic