Tại sao một số người dùng hệ thống có / usr / bin / false là Shell của họ?

Mục lục:

Tại sao một số người dùng hệ thống có / usr / bin / false là Shell của họ?
Tại sao một số người dùng hệ thống có / usr / bin / false là Shell của họ?

Video: Tại sao một số người dùng hệ thống có / usr / bin / false là Shell của họ?

Video: Tại sao một số người dùng hệ thống có / usr / bin / false là Shell của họ?
Video: Loa có tiếng sôi là lỗi gì - xử lý loa bị sôi, rè bằng cách nào? - YouTube 2024, Có thể
Anonim
Một khi bạn bắt đầu đào sâu vào một hệ thống Linux, bạn có thể tìm thấy một số điều khó hiểu hoặc bất ngờ, ví dụ như / usr / bin / false. Tại sao nó ở đó và mục đích của nó là gì? Bài đăng Hỏi & Đáp của SuperUser hôm nay có câu trả lời cho câu hỏi của người đọc tò mò.
Một khi bạn bắt đầu đào sâu vào một hệ thống Linux, bạn có thể tìm thấy một số điều khó hiểu hoặc bất ngờ, ví dụ như / usr / bin / false. Tại sao nó ở đó và mục đích của nó là gì? Bài đăng Hỏi & Đáp của SuperUser hôm nay có câu trả lời cho câu hỏi của người đọc tò mò.

Phiên Hỏi & Đáp hôm nay đến với chúng tôi theo lịch sự của SuperUser - một phân khu của Stack Exchange, một nhóm các trang web Hỏi & Đáp do cộng đồng điều hành.

Câu hỏi

Người dùng SuperUser reader7326333 muốn biết tại sao một số người dùng hệ thống có / usr / bin / false làm shell của họ:

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

Tại sao một số người dùng hệ thống có / usr / bin / false làm shell của họ?

Câu trả lời

Những người đóng góp của SuperUser, Toby Speight và bbaassssiiee có câu trả lời cho chúng tôi. Đầu tiên, 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.

Tiếp theo là câu trả lời từ Toby Speight:

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.

Và câu trả lời cuối cùng của chúng tôi từ 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.

Có cái gì để thêm vào lời giải thích? Tắt âm thanh trong các ý kiến. Bạn muốn đọc thêm câu trả lời từ những người dùng Stack Exchange có hiểu biết công nghệ khác? Xem toàn bộ chuỗi thảo luận tại đây.

Tín dụng hình ảnh: Tài liệu OpenStack (Dự án OpenStack)

Đề xuất: