
嘗試在 Ubuntu 22.04 LTS (GNU/Linux 5.15.0-39-generic x86_64) 上設定 valheim 專用伺服器時
我正在嘗試運行這些說明來安裝 steamcmd:
建立一個名為 steam 的使用者帳戶以安全地執行 SteamCMD,並將其與作業系統的其餘部分隔離。警告:請勿在以 root 使用者身分執行時執行 steamcmd。這樣做存在安全風險。
- 作為 root 用戶,創建 steam 用戶:
sudo useradd -m steam
sudo passwd steam
- 進入其主資料夾:
sudo -u steam -s
cd /home/steam
來自存儲庫的包
- 建議從您的發行版儲存庫安裝 SteamCMD 軟體包(如果可用):Ubuntu/Debian:
sudo apt install steamcmd
----這是發生的事情的副本----
server@ubuntu:~$ sudo useradd -m steam
[sudo] password for server:
useradd: user 'steam' already exists
server@ubuntu:~$ sudo passwd steam
New password:
Retype new password:
passwd: password updated successfully
server@ubuntu:~$ sudo -u steam -s
steam@ubuntu:/home/server$ cd /home/steam
steam@ubuntu:~$ sudo apt install steamcmd
[sudo] password for steam:
steam is not in the sudoers file. This incident will be reported.
此時我有不同的結果試圖解決錯誤
我知道 Steam 需要 root 存取權限,並且需要將其添加到某個地方。
答案1
sudo 抱怨的是 steam 不在 sudo 群組中,因此在 sudo 工作的用戶上運行它sudo adduser steam sudo
sudo
取得root權限adduser
用於新增使用者並將使用者新增至群組以獲取更多資訊運行adduser --help
steam
要新增到群組的用戶sudo
新增使用者的群組
為什麼會出現這種情況?嗯,這是一項安全功能,允許某些用戶使用 sudo,但其他用戶則不能。注意/etc/sudoers
sudo 的設定規則,但我不建議編輯它
希望回答了您的問題,歡迎詢問 Ubuntu