![sudoer를 사용하지 않고 sudo를 사용할 수 있는 이유는 무엇입니까?](https://linux55.com/image/209257/sudoer%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%A7%80%20%EC%95%8A%EA%B3%A0%20sudo%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%A0%20%EC%88%98%20%EC%9E%88%EB%8A%94%20%EC%9D%B4%EC%9C%A0%EB%8A%94%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
답변1
클라우드 환경에서는 CentOS 7을 포함한 많은 배포판에서클라우드 초기화처음 부팅 시 시스템을 구성합니다.
/etc/cloud/cloud.cfg
CentOS 7 클라우드 이미지를 보면 다음을 찾을 수 있습니다.
system_info:
default_user:
name: centos
lock_passwd: true
gecos: Cloud User
groups: [wheel, adm, systemd-journal]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
distro: rhel
paths:
cloud_dir: /var/lib/cloud
templates_dir: /etc/cloud/templates
ssh_svcname: sshd
"라는 이름의 사용자를 생성 하고 해당 사용자 에게 centos
구성을 적용합니다 . 그러면 다음을 포함하는 파일이 생성됩니다 .sudo
ALL=(ALL) NOPASSWD:ALL
cloud-init
/etc/sudoers.d/90-cloud-init-users
# Created by cloud-init v. 18.2 on Mon, 08 Aug 2022 22:07:23 +0000
# User rules for centos
centos ALL=(ALL) NOPASSWD:ALL
이것이 centos
사용자가 sudo
액세스할 수 있는 이유입니다.