Почему у некоторых пользователей системы есть / usr / bin / false в качестве оболочки?

Оглавление:

Почему у некоторых пользователей системы есть / usr / bin / false в качестве оболочки?
Почему у некоторых пользователей системы есть / usr / bin / false в качестве оболочки?

Видео: Почему у некоторых пользователей системы есть / usr / bin / false в качестве оболочки?

Видео: Почему у некоторых пользователей системы есть / usr / bin / false в качестве оболочки?
Видео: ТЕРРАРИЯ, Но Я ВЫПОЛНИЛ ВСЕ ДОСТИЖЕНИЯ! TERRARIA! - YouTube 2024, Май
Anonim
Как только вы начнете копаться в системе Linux, вы можете найти некоторые запутанные или неожиданные вещи, например, / usr / bin / false. Почему он существует и какова его цель? Сегодняшний вопрос о Q & A SuperUser имеет ответ на вопросы любопытного читателя.
Как только вы начнете копаться в системе Linux, вы можете найти некоторые запутанные или неожиданные вещи, например, / usr / bin / false. Почему он существует и какова его цель? Сегодняшний вопрос о Q & A SuperUser имеет ответ на вопросы любопытного читателя.

Сегодняшняя сессия вопросов и ответов приходит к нам благодаря SuperUser - подразделению Stack Exchange, основанной на сообществах сайтам Q & A.

Вопрос

Считыватель SuperUser user7326333 хочет знать, почему у некоторых пользователей системы есть / usr / bin / false в качестве оболочки:

Why do some system users have /usr/bin/false as their shell? What does that mean?

Почему у некоторых пользователей системы есть / usr / bin / false в качестве оболочки?

Ответ

Ответы для разработчиков SuperUser duDE, Тоби Спейт и bbaassssiiee. Сначала, duDE:

This helps to prevent users from logging onto a system. Sometimes you need a user account for a specific task. Nevertheless, no one should be able to interact with this account on the computer. These are, on one hand, system user accounts. On the other hand, this is an account for which FTP or POP3 access is possible, but just no direct shell login.

If you look more closely at the /etc/passwd file, you will find the /bin/false command as a login shell for many system accounts. Actually, false is not a shell, but a command that does nothing and then also ends with a status code that signals an error. The result is simple. The user logs in and immediately sees the login prompt again.

Вслед за ответом Тоби Спранта:

These users exist to be the owner of specific files or processes and are not intended to be login accounts. If the value of the “shell” field is not listed in /etc/shells, then programs such as FTP daemons do not allow access. Additionally, for programs that do not check /etc/shells, they make use of the fact that /bin/false will immediately return and deny an interactive shell.

И наш окончательный ответ от bbaassssiiee:

Some users have /usr/bin/false, others have /sbin/nologin, or they may even have /usr/bin/passwd. They can either be system users that are needed to isolate program permissions or human users of programs that use the password files for authentication.

Есть что добавить к объяснению? Отключить звук в комментариях. Хотите узнать больше ответов от других пользователей Windows? Посмотрите здесь полную дискуссионную тему.

Image Credit: OpenStack Docs (OpenStack Project)

Рекомендуемые: