19
05
月
2020
很多時候我們不希望直接使用 root 來進行登入
但是又希望一般使用者可以執行 root 權限,此時我們需要通過 sudo 來幫忙,在 Ubuntu 裡面這些功能是已經內鍵了,但 Debian 則需要我們手動來安裝。
首先先通過 apt 來安裝 sudo
apt install sudo
接著編輯 /etc/sudoers 這個檔案
vi /etc/sudoers
在 root ALL=(ALL:ALL) ALL 底下加入使用者的名稱
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
user ALL=(ALL:ALL) ALL #將 user 修改為您的使用者名稱
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
延伸閱讀
- 關閉 Debian/Ubuntu 使用 Ctrl + Alt + Del 來重啟
- Debian 使用 Google Authenticator 登入 SSH
- Debian 10 + Bind9 9.16.3 編譯安裝
- 什麼是原生 IP?
- Debian 10 把 rc.local 加回來
- Debian 10 可以直接於 vim 中使用複製貼上
- 在 Debian 10 安裝 Wireguard (安全又快速的 VPN 隧道)
- 在 Debian 10 中增加 4G 連網 (本篇使用 wvdial)
更多閱讀
- 上一篇:Debian 10 把 rc.local 加回來
- 下一篇:什麼是原生 IP?