# \[nCloud] Ubuntu 20.04 불필요한 계정 삭제 방법

## \[nCloud] Ubuntu 20.04 불필요한 계정 삭제 방법

> 네이버 클라우드에서 불필요한 계정을 삭제 하기 위해 아래와 같은 작업이 필요 함.

### 점검 항목 설명&#x20;

> ```
> 시스템 계정 중 불필요한 계정(퇴직, 전직, 휴직 등의 이유로 사용하지 않는 계정 및 장기적으로 사용하지 않는 계정 등)이 존재하는지 점검
> 아래의 Default 계정은 반드시 삭제
> adm, lp, sync, shutdown, halt, news, uucp, operator, games, gopher, nfsnobody, squid
>
> (PCI/DSS) 90 이상 접속하지 않은 계정 삭제
> ```

### 권고 설정 및 판단 기준 &#x20;

> 불필요한 계정이 존재하지 않는 경우 양호

### 조치 방법&#x20;

> ```
> 현재 등록된 계정 현황 확인 후 불필요한 계정 삭제
> Step 1) 서버에 등록된 불필요한 사용자 계정 확인
> Step 2) userdel 명령으로 불필요한 사용자 계정 삭제
> #userdel <user_name>
>
> ※ /etc/passwd 파일에서 계정 앞에 #을 삽입하여도 주석처리가 되지 않으므로, 조치 시에는 반드시 계정을 삭제하도록 권고함
> ```

### \*\* 시스템 에서 확인 및 제거 방법

> 아래의 방법으로 불필요한 계정을 삭제 함.&#x20;

```
########## 네이버 클라우드 플랫폼에서는 계정을 삭제 하더라도 리부팅 되면 유저가 다시 생성 됨.
########## 이를 해결하기 위해 아래와 같은 방법으로 처리 함.

########## 아래의 명령어는 관리되는 유저와 그룹 확인이 가능
# /usr/bin/systemd-sysusers --cat-config

########## 계정 삭제
# userdel lp
# userdel sync
# userdel games
# userdel uucp
# userdel news

########## 재부팅 후에도 계정이 생성 되지 않게 설정 (basic.conf 에서 아래의 계정을 삭제 후 저장)
# vi /usr/lib/sysusers.d/basic.conf
u sync       4:65534 - /bin                 /bin/sync
u games      5:60    - /usr/games           /usr/sbin/nologin
u lp         7       - /var/spool/lpd       /usr/sbin/nologin
u news       9       - /var/spool/news      /usr/sbin/nologin
u uucp       10      - /var/spool/uucp      /usr/sbin/nologin
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.skill.or.kr/naver-cloud-infomation/ncloud-ubuntu-delete-unnecessary-accounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
