Ubuntu 23.04 root 権限を特定のユーザーに全て委譲する

環境
Ubuntu 23.04

操作方法
1.sudoをインストールします。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# apt -y install sudo
# apt -y install sudo
# apt -y install sudo

2.root 権限を特定のユーザーに全て委譲する
# visudo

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# 最終行に追記 : [ark] ユーザーは root 権限を全て利用できる
ark ALL=(ALL:ALL) ALL
# 最終行に追記 : [ark] ユーザーは root 権限を全て利用できる ark ALL=(ALL:ALL) ALL
# 最終行に追記 : [ark] ユーザーは root 権限を全て利用できる
ark ALL=(ALL:ALL) ALL

3.[Ctrl + x]を押します
次は何でしょうか? Q
visudo を終了する

4.[ark] ユーザーで動作確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ /sbin/reboot
Call to Reboot failed: Interactive authentication required.
$ /sbin/reboot Call to Reboot failed: Interactive authentication required.
$ /sbin/reboot
Call to Reboot failed: Interactive authentication required.

$ sudo /sbin/reboot

Ubuntu 23.04

Posted by arkgame