為什麼有些系統使用者使用/usr/bin/false作為shell?

一旦開始深入研究Linux系統,您可能會發現一些令人困惑或意想不到的事情,例如/usr/bin/false。它為什麼在那裡?它的目的是什麼?今天的超級使用者問答帖子回答了一位好奇讀者的問題。...

為什麼有些系統使用者使用/usr/bin/false作為shell?

一旦開始深入研究Linux系統,您可能會發現一些令人困惑或意想不到的事情,例如/usr/bin/false。它為什麼在那裡?它的目的是什麼?今天的超級使用者問答帖子回答了一位好奇讀者的問題。

今天的問答環節是由SuperUser提供的,SuperUser是Stack Exchange的一個分支,是一個由社群驅動的問答網站分組。

問題

超級使用者讀者user7326333想知道為什麼一些系統使用者使用/usr/bin/false作為shell:

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

為什麼有些系統使用者使用/usr/bin/false作為shell?

答案

超級使用者貢獻者杜德,託比·斯佩特,和BBaasssiee為我們提供了答案。首先,夥計:

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 daem*** 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.

BBaasssiee最後的回答是:

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


有什麼要補充的解釋嗎?在評論中發出聲音。想從其他精通技術的Stack Exchange使用者那裡瞭解更多答案嗎?在這裡檢視完整的討論主題。

圖片來源:OpenStack文件(OpenStack專案)

  • 發表於 2021-04-08 05:49
  • 閱讀 ( 32 )
  • 分類:網際網路

你可能感興趣的文章

使用簡單的shell指令碼修復html格式

...容(添加了處理命令列引數的功能)。 為使用者提供額外的匯出選項,如PDF(透過if-then或case語句根據輸入新增選項)。 ...

  • 發佈於 2021-03-13 00:12
  • 閲讀 ( 48 )

什麼是shell指令碼,為什麼要使用它

... 下面是一個示例shell指令碼/etc/profile,每次使用者登入時都會執行該指令碼。想象一下用手輸入這些命令! ...

  • 發佈於 2021-03-13 04:53
  • 閲讀 ( 54 )

ssh和vpn的區別是什麼?哪個更安全?

...多地關注於命令列,這既是贊成也是反對。這使得非技術使用者更難掌握。您可以調出目標計算機的圖形介面,但這樣做需要額外的語法,切斷連線通常會關閉您開啟的任何軟體。 ...

  • 發佈於 2021-03-14 04:40
  • 閲讀 ( 66 )

如何使用“helloworld”指令碼開始使用python

...”或TTHW,這個度量在當今大多數現代程式設計特性的以使用者為中心的設計過程中起著至關重要的作用。 ...

  • 發佈於 2021-03-28 01:18
  • 閲讀 ( 52 )

ssh是什麼?它代表什麼?

... 在SSH開發之前,使用者和管理員使用不安全的網路協議(如Telnet)與遠端裝置通訊。這些現已過時的協議以明文形式傳送密碼和登入資訊等關鍵資訊,使它們成為攻擊者的容易攻擊目標。...

  • 發佈於 2021-03-28 08:50
  • 閲讀 ( 55 )

哪個linux shell最好?比較了5種常見的貝殼

... 這是Linux使用者中最流行的shell。如果沒有Bourne-Again-Shell(bash)作為等式的一部分,甚至很難想到Shell。許多Linux發行版附帶bash作為預設shell,因為bash是預設的gnushell。在1989年發行...

  • 發佈於 2021-03-30 18:45
  • 閲讀 ( 51 )

你知道嗎?windows從來沒有“系統托盤”

...示位於“通知區”,那麼“系統托盤”一詞從何而來呢?為什麼Windows10稱之為“系統托盤”-但只有一次? 那是通知區,謝謝! 如果你在windows10、windows7、windowsvista、windowsxp或windows98上瀏覽,你在Windows介面上找不到任何關於“...

  • 發佈於 2021-04-01 19:18
  • 閲讀 ( 37 )

如何使用chsh在linux上更改預設shell

...編寫的,並不是從任何其他shell家族派生的。它的目的是使用者友好。在它的許多其他特權中,fish根據您的歷史記錄和當前資料夾的內容為命令提供建議,類似於預測文字。 ksh:KornShell提供了一種特別強大的指令碼語言。 相關...

  • 發佈於 2021-04-02 06:04
  • 閲讀 ( 66 )

如何在linux上使用cd命令

...尾隨的正斜槓,這樣就可以重複製表符完成過程。這也是為什麼第一個命令後面有一個正斜槓。第二張沒有,因為那張是打出來的。 您可以使用波浪號(~)作為從檔案系統中任意位置快速返回主目錄的速記方式;只需鍵入以下...

  • 發佈於 2021-04-02 08:58
  • 閲讀 ( 68 )

linux下如何使用which命令

...r/本地/**in /usr/本地/bin /usr/**in公司 /usr/箱 /斯賓 /垃圾箱 /使用者/遊戲 /usr/本地/遊戲 /快照/bin 檔案系統中有許多名為/**in和/bin的資料夾,這可能會導致一些混亂。 小心那些路 假設我們有一個名為htg的程式的更新版本。它位於當...

  • 發佈於 2021-04-02 20:07
  • 閲讀 ( 50 )
vjowekughn075
vjowekughn075

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦