Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Ubuntu 複製檔案出現 Permission denied?設定 root 密碼以管理員身分操作

編輯:關於 Linux

現象

複製檔案至系統目錄(如 /usr)提示 Permission denied。

治標方案:暴力授權(不建議長期使用)

sudo chmod -R 777 /usr

-R 遞歸,777 全權限,安全風險極高。

治本方案:啟用 root 帳號並切換

  1. 以安裝時建立的使用者登入。
  2. 設定 root 密碼:sudo passwd → 輸入兩次新密碼。
  3. 切換至 root:su root 輸入密碼。
  4. 以 root 身分執行複製操作,不再受限。

結語

正規途徑啟用 root 並切換身分,比暴力修改權限更安全、更符合 Linux 管理慣例。

Copyright © Windows教程網 All Rights Reserved