빈 /etc/sudoers를 루트로 수정하는 방법은 무엇입니까?

빈 /etc/sudoers를 루트로 수정하는 방법은 무엇입니까?

내가 해냈어

root@masi:~# visudo -x /etc/sudoers
root@masi:~# exit
logout
masi@masi:~$ sudo apt-get install vim
>>> /etc/sudoers: syntax error near line 1 <<<

{\n}파일 이 이제 /etc/sudoers비어 있고 .

그래요

root@masi:/home/masi# apt-get install --reinstall sudo
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/855 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 136923 files and directories currently installed.)
Preparing to unpack .../sudo_1.8.10p3-1+deb8u3_amd64.deb ...
Unpacking sudo (1.8.10p3-1+deb8u3) over (1.8.10p3-1+deb8u3) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u4) ...
Setting up sudo (1.8.10p3-1+deb8u3) ...

root@masi:/home/masi# exit

masi@masi:~$ sudo apt-get install vim
>>> /etc/sudoers: syntax error near line 1 <<<
...

답변1

해결책은 adonis'에 의한 루트입니다 /etc/sudoers.gedit /etc/sudoers

#
# 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

# 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

완벽한!

관련 정보