關於從第一個使用者建立開始的權限提升

關於從第一個使用者建立開始的權限提升

當安裝具有 gnome 介面的 Ubuntu 22.04.1 LTS 時,系統會要求建立第一個用戶,而我們無法覆蓋它。

此用戶帳戶是電腦的本機帳戶,我不想將此帳戶傳達給電腦的最終用戶,因為我希望此帳戶僅用於 IT 部門的管理。

那麼這台機器就加入了網域,而且它的使用者的網域帳戶必須是該機器的sudoers,我在sudoers檔案中加入好了。

當我在終端機中時,我不擔心權限提升,而是請求使用者的網域帳戶。

另一方面,在圖形介面中,如果我想配置VPN或安裝應用程序,則需要locauser帳戶!

我不明白這是如何運作的。你有好主意嗎?

答案1

我終於找到了比我想像的更快的解決方案:

關於 Ubuntu 提示系統策略阻止修改所有使用者的網路設置

https://unix.stackexchange.com/questions/534469/system-policy-prevents-control-of-network-connections

此解決方案的工作原理:

Create a file named universal.pkla in the /etc/polkit-1/localauthority/50-local.d folder with these contents:

    [Allow access to anything for remote users]
    Identity=unix-user:*
    Action=*
    ResultAny=yes
    ResultInactive=yes
    ResultActive=yes

Then restart polkit with "sudo systemctl restart polkit.service" or reboot. I haven't seen any polkit authentication prompts since.

謝謝 !

相關內容