[AIX 네트워크 관리 29] SNMP (1) SNMP 개요와 SNMPv3 구조, 인증·암호 키, 키 갱신
https://archive.horanglab.com/posts/aix-net-snmp-1
핵심 정리
- AIX 설치 때 암호화하지 않는 SNMPv3가 기본으로 설치되어 부팅 때 시작합니다.
/etc/snmpd.conf(v1)에 만든 커뮤니티·트랩·SMUX 항목은/etc/snmpdv3.conf로 직접 옮겨야 합니다. 암호화 버전은 Expansion Pack에 있고,snmpv3_ssw로 버전을 바꿉니다. - SNMPv3는 메시지 보안용 USM(사용자 기반)과 접근 제어용 VACM(뷰 기반)을 쓰며, 에이전트 설정은
/etc/snmpdv3.conf, 관리자 설정은/etc/clsnmp.conf입니다. - 포트: 관리자(clsnmp) 요청은 에이전트의 UDP 161, 트랩은 UDP 162, SMUX 피어(gated 등)는 TCP 199, DPI2 서브에이전트(hostmibd 등)는
dpiPortForTCP.0을 먼저 물어 연결합니다. 161이 아닌 포트는SNMP_PORT환경 변수(관리자는 clsnmp.conf의 targetAgent)로 정합니다. - 키는
pwtokey로 비밀번호와 에이전트 식별(IP나 engineID)에서 만듭니다. 지역화 키는 그 에이전트에서만 쓰고, clsnmp.conf에는 지역화하지 않은 키를 둡니다. HMAC-MD5·HMAC-SHA와 DES 조합으로 USM_USER 구성은 아홉 가지입니다. - 키 갱신: 관리자에서
pwchange로 keyChange 값을 만들고,clsnmp -h 사용자 set usmUserAuthKeyChange.<engineID 십진>.<이름 길이>.<이름 십진> 값으로 에이전트 키를 바꾼 뒤(5분 안에 snmpdv3.conf에 반영),pwtokey로 새 키를 clsnmp.conf에 넣고clsnmp walk로 시험합니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (두 판의 내용이 거의 같음) |
| 원문 | Networks and communication management — 5.3판 349358쪽, 6.1판 455464쪽 |
| 파일 | /etc/snmpdv3.conf, /etc/clsnmp.conf, /etc/snmpd.conf, /etc/snmpd.boots, /etc/environment, /usr/samples/snmpdv3, /usr/samples/snmpd/smux, /usr/samples/snmpd/dpi2 |
| 관련 명령어 | clsnmp, pwtokey, pwchange, snmpv3_ssw, snmpd, hostmibd, aixmibd, snmpmibd |
네트워크 관리 기능은 SNMP(Simple Network Management Protocol)로 시스템 네트워크를 종합적으로 관리해, 네트워크 호스트가 관리 정보를 교환하게 합니다.
SNMP는 TCP/IP 기반 인터넷에서 쓰도록 설계된 인터네트워킹 프로토콜입니다.
AIX 운영 체제를 설치하면 암호화하지 않는 SNMPv3 버전이 기본으로 설치되어 시스템 부팅 때 시작합니다. /etc/snmpd.conf 파일에 직접 구성한 커뮤니티, 트랩, SMUX 항목이 있으면 /etc/snmpdv3.conf 파일로 직접 옮겨야 합니다. 커뮤니티 이전은 SNMPv1에서 SNMPv3로 이전을 봅니다.
Communications Programming Concepts의 SNMP Overview for Programmers도 참고할 수 있습니다.
SNMP 네트워크 관리는 TCP/IP 기반 네트워크 응용 프로그램에서 널리 쓰이는 익숙한 클라이언트/서버 모델을 바탕으로 합니다. 관리할 각 호스트는 에이전트라는 프로세스를 실행합니다. 에이전트는 호스트의 MIB(Management Information Base) 데이터베이스를 유지하는 서버 프로세스입니다. 네트워크 관리 의사 결정에 관여하는 호스트는 관리자(manager)라는 프로세스를 실행할 수 있습니다. 관리자는 MIB 정보 요청을 만들고 응답을 처리하는 클라이언트 응용 프로그램입니다. 또 관리자는 에이전트 서버에 MIB 정보를 바꾸는 요청을 보낼 수 있습니다.
AIX의 SNMP가 지원하는 RFC
| RFC | 제목 |
|---|---|
| RFC 1155 | Structure and Identification of Management Information for TCP/IP-based Internets |
| RFC 1157 | A Simple Network Management Protocol (SNMP) |
| RFC 1213 | Management Information Base for Network Management of TCP/IP-based internets: MIB-II |
| RFC 1227 | SNMP single multiplexer (SMUX) protocol and Management Information Base (MIB) |
| RFC 1229 | Extensions to the generic interface Management Information Base (MIB) |
| RFC 1231 | IEEE 802.5 token-ring Management Information Base (MIB) |
| RFC 1398 | Definitions of Managed Objects for the Ethernet-like Interface Types |
| RFC 1512 | FDDI Management Information Base |
| RFC 1514 | Host Resources MIB |
| RFC 1592 | Simple Network Management Protocol-Distributed Program Interface Version 2 |
| RFC 1905 | Protocol Operations for Version 2 of the Simple Network Management Protocol (SNMPv2) |
| RFC 1907 | Management Information Base for Version 2 of the Simple Network Management Protocol (SNMPv2) |
| RFC 2572 | Message Processing and Dispatching for the Simple Network Management Protocol (SNMP) |
| RFC 2574 | User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3) |
| RFC 2575 | View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP) |
영어 원문
SNMP for network management
The Network Management facility provides comprehensive management of system networks through the use of Simple Network Management Protocol (SNMP), enabling network hosts to exchange management information.
SNMP is an internetworking protocol designed for use with TCP/IP-based internets.
When the AIX operating system is installed, the SNMPv3 non-encrypted version is installed by default and is started at system boot time. If you have your own communities, traps, and SMUX entries configured in your /etc/snmpd.conf file, you will need to migrate those manually to the /etc/snmpdv3.conf file. For information on migrating the communities, see Migrating from SNMPv1 to SNMPv3.
You might also want to consult the information in SNMP Overview for Programmers in Communications Programming Concepts.
SNMP network management is based on the familiar client/server model that is widely used in TCP/IP-based network applications. Each host that is to be managed runs a process called an agent. The agent is a server process that maintains the Management Information Base (MIB) database for the host. Hosts that are involved in network management decision-making can run a process called a manager. A manager is a client application that generates requests for MIB information and processes responses. In addition, a manager can send requests to agent servers to modify MIB information.
SNMP in AIX provides support for the following RFCs
- RFC 1155 — Structure and Identification of Management Information for TCP/IP-based Internets
- RFC 1157 — A Simple Network Management Protocol (SNMP)
- RFC 1213 — Management Information Base for Network Management of TCP/IP-based internets: MIB-II
- RFC 1227 — Simple Network Management Protocol (SNMP) single multiplexer (SMUX) protocol and Management Information Base (MIB)
- RFC 1229 — Extensions to the generic interface Management Information Base (MIB)
- RFC 1231 — IEEE 802.5 token-ring Management Information Base (MIB)
- RFC 1398 — Definitions of Managed Objects for the Ethernet-like Interface Types
- RFC 1512 — FDDI Management Information Base
- RFC 1514 — Host Resources MIB
- RFC 1592 — Simple Network Management Protocol-Distributed Program Interface Version 2
- RFC 1905 — Protocol Operations for Version 2 of the Simple Network Management Protocol (SNMPv2)
- RFC 1907 — Management Information Base for Version 2 of the Simple Network Management Protocol (SNMPv2)
- RFC 2572 — Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)
- RFC 2574 — User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)
- RFC 2575 — View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP)
SNMPv3
이전 버전의 AIX 운영 체제에서는 SNMPv1이 AIX에서 쓸 수 있는 유일한 SNMP 버전이었습니다. AIX 운영 체제에 들어 있는 SNMPv3는 메시지 보안과 접근 제어를 위한 강력하고 유연한 틀을 제공합니다.
이 절의 정보는 SNMPv3에만 해당합니다.
메시지 보안은 다음을 제공하는 것입니다.
- 데이터가 전송 중 바뀌지 않았음을 보장하는 데이터 무결성 검사
- 요청이나 응답이 주장하는 출발지에서 왔음을 보장하는 데이터 출처 확인
- 메시지 시간 적절성 검사와, 선택적으로 엿듣기를 막는 데이터 기밀성
SNMPv3 구조는 메시지 보안용 USM(User-based Security Model)과 접근 제어용 VACM(View-based Access Control Model)을 도입합니다. 이 구조는 서로 다른 보안, 접근 제어, 메시지 처리 모델을 동시에 쓰는 것을 지원합니다. 예를 들어 원하면 커뮤니티 기반 보안을 USM과 동시에 쓸 수 있습니다.
USM은 사용자라는 개념을 쓰며, 사용자마다 보안 매개변수(보안 수준, 인증과 암호 프로토콜, 키)를 에이전트와 관리자 양쪽에 구성합니다. USM으로 보낸 메시지는 비밀번호가 평문으로 보내지고 추적에 표시되는 커뮤니티 기반 보안으로 보낸 메시지보다 더 잘 보호됩니다. USM에서는 관리자와 에이전트가 주고받는 메시지에 데이터 무결성 검사와 데이터 출처 인증이 있습니다. 시간 표시와 요청 ID로 (비연결 전송 프로토콜 때문에 보통 일어나는 것을 넘는) 메시지 지연과 재전송 공격을 막습니다. 데이터 기밀성, 곧 암호화도 허용되는 곳에서는 따로 설치하는 제품으로 쓸 수 있습니다. SNMP 암호화 버전은 AIX Expansion Pack에 있습니다.
VACM을 쓰려면 데이터 모음(뷰), 그 데이터의 사용자 그룹, 특정 사용자 그룹이 읽기, 쓰기, 트랩 수신에 쓸 수 있는 뷰를 정의하는 접근 문을 정의합니다.
SNMPv3는 에이전트 구성을 나타내는 MIB 객체에 SNMP SET 명령을 써서 SNMP 에이전트를 동적으로 구성하는 기능도 도입합니다. 이 동적 구성 지원으로 로컬이나 원격에서 구성 항목을 더하고, 지우고, 바꿀 수 있습니다.
SNMPv3 접근 정책과 보안 매개변수는 SNMP 에이전트의 /etc/snmpdv3.conf 파일과 SNMP 관리자의 /etc/clsnmp.conf 파일에 지정합니다. 이 파일들을 구성하는 시나리오는 Creating users in SNMPv3를 봅니다. Files Reference의 /etc/snmpdv3.conf와 /etc/clsnmp.conf 파일 형식도 참고할 수 있습니다.
영어 원문
SNMPv3
In earlier versions of the AIX operating system, SNMPv1 was the only available version of SNMP for AIX. SNMPv3, provided in the AIX operating system, delivers a powerful and flexible framework for message security and access control.
The information in this section applies to SNMPv3 only.
Message security involves providing the following:
Data integrity checking to ensure that the data was not altered in transit.
Data origin verification to ensure that the request or response originates from the source that it claims to have come from.
Message timeliness checking and, optionally, data confidentiality to protect against eavesdropping.
The SNMPv3 architecture introduces the User-based Security Model (USM) for message security and the View-based Access Control Model (VACM) for access control. The architecture supports the concurrent use of different security, access control, and message processing models. For example, community-based security can be used concurrently with USM, if desired.
USM uses the concept of a user for which security parameters (levels of security, authentication and privacy protocols, and keys) are configured at both the agent and the manager. Messages sent using USM are better protected than messages sent with community-based security, where passwords are sent in the clear and displayed in traces. With USM, messages exchanged between the manager and the agent have data integrity checking and data origin authentication. Message delays and message replays (beyond what happens normally due to a connectionless transport protocol) are prevented by the use of time indicators and request IDs. Data confidentiality, or encryption, is also available, where permitted, as a separately installable product. The SNMP encrypted version can be found on the AIX Expansion Pack.
The use of VACM involves defining collections of data (called views), groups of users of the data, and access statements that define which views a particular group of users can use for reading, writing, or receipt in a trap.
SNMPv3 also introduces the ability to dynamically configure the SNMP agent using SNMP SET commands against the MIB objects that represent the agent's configuration. This dynamic configuration support enables addition, deletion, and modification of configuration entries either locally or remotely.
SNMPv3 access policies and security parameters are specified in the /etc/snmpdv3.conf file on the SNMP agent and /etc/clsnmp.conf file on the SNMP manager. For a scenario on how to configure these files, see Creating users in SNMPv3. You can also refer to the /etc/snmpdv3.conf and /etc/clsnmp.conf file formats in Files Reference.
SNMPv3 구조
SNMPv3 구조는 네 가지 주요 부분으로 이루어집니다.
요청한 데이터를 제공하려고 이 시스템들이 상호 작용하는 모습은 다음 그림과 같습니다.
그림 29. SNMPv3 구조의 주요 부분
SNMP 관리자 SNMPv3 에이전트(snmpdv3) DPI2 서브에이전트
+---------+ 요청 -> +------------------------+ <- 응답/트랩 +-----------+
| clsnmp | -- UDP 161 ---> | DPI2 agent | <------------> | hostmibd |
| | <- 응답 ------- | | dpiPortForTCP.0+-----------+
| | <- 트랩 UDP 162 | smux server | SMUX 피어
+---------+ | | <-- TCP 199 --> +-----------+
+------------------------+ 요청, 응답/트랩 | gated |
+-----------+
SNMP 에이전트
SNMP 에이전트는 SNMP 관리자에게서 요청을 받고 응답합니다.
또 SNMP 에이전트는 시스템의 모든 DPI2 서브에이전트, SMUX 피어와 통신합니다. SNMP 에이전트는 일부 MIB 변수를 관리하며, 모든 DPI2 서브에이전트와 SMUX 피어는 자기 MIB 변수를 SNMP 에이전트에 등록합니다.
clsnmp(SNMP 관리자)가 요청을 보내면 SNMP 에이전트의 UDP 161로 갑니다. SNMPv1이나 SNMPv2c 요청이면 SNMP 에이전트가 커뮤니티 이름을 확인하고 요청을 처리합니다. SNMPv3 요청이면 SNMP 에이전트는 인증 키와 (암호화 버전이 실행 중이면) 암호 키로 데이터를 요청하는 사용자를 인증하고, 사용자에게 요청을 처리하는 데 필요한 접근 권한이 있는지 확인하려고 합니다. 사용자를 인증할 수 없거나 사용자에게 올바른 접근 권한이 없으면 SNMP 에이전트는 요청을 들어주지 않습니다. SNMPv3 사용자 만들기는 Creating users in SNMPv3를 봅니다.
사용자가 인증되고 올바른 접근 권한이 있으면 SNMP 에이전트가 요청을 처리합니다. SNMP 에이전트는 요청한 MIB 변수를 찾습니다. 요청한 MIB 변수를 SNMP 에이전트가 직접 관리하면 요청을 처리해 SNMP 관리자에게 응답을 돌려보냅니다. DPI2 서브에이전트나 SMUX 피어가 관리하면, SNMP 에이전트는 MIB 변수를 관리하는 DPI2 서브에이전트나 SMUX 피어에 요청을 전달해 처리하게 한 뒤 SNMP 관리자에게 응답합니다.
DPI2 서브에이전트
hostmibd 같은 DPI2 서브에이전트는 DPI2 에이전트와 통신하며, SNMPv3에서 DPI2 에이전트는 SNMP 에이전트의 일부입니다.
DPI2 서브에이전트는 dpiPortForTCP.0으로 DPI2 에이전트에 응답과 트랩을 보냅니다. 이것은 잘 알려진 포트가 아니므로 DPI2 서브에이전트는 먼저 dpiPortForTCP.0의 포트 번호를 요청해야 합니다. 이 요청은 SNMP 에이전트의 UDP 161로 보내며, SNMP 에이전트가 dpiPortForTCP.0의 포트 번호로 DPI2 서브에이전트에 응답합니다. 포트 번호를 받으면 DPI2 서브에이전트는 받은 포트 번호로 DPI2 에이전트와 연결을 맺습니다. 그런 다음 DPI2 서브에이전트는 자기 MIB 하위 트리를 DPI2 에이전트에 등록합니다.
참고: SNMP 에이전트가 UDP 161이 아닌 포트에서 기다리게 하려면 SNMP_PORT 환경 변수를 설정해야 합니다. 이 변수를 설정하는 방법은 두 가지입니다.
방법 1: DPI2 서브에이전트를 멈추고 다음 명령을 입력합니다.
SNMP_PORT=<port_number> /usr/sbin/aixmibd -d 128SNMP_PORT=<port_number> /usr/sbin/hostmibd -d 128SNMP_PORT=<port_number> /usr/sbin/snmpmibd -d 128
여기서
port_number는 쓰려는 포트 번호입니다. 명령 실행이 끝나면 DPI2 서브에이전트를 시작합니다.방법 2:
/etc/environment파일에SNMP_PORT변수를 넣고 새 포트 값을 할당합니다. aixmibd, hostmibd, snmpmibd, snmpd 데몬은/etc/rc.tcpip에서 그대로 실행되게 둡니다. 이 방법에서는 aixmibd, hostmibd, snmpmibd 명령을 명령행에서 실행할 필요가 없습니다.
연결이 맺어지고 MIB 하위 트리가 등록되면 DPI2 서브에이전트는 DPI2 에이전트에서 받은 요청에 응답할 준비가 됩니다. 요청을 받으면 DPI2 서브에이전트가 요청을 처리하고 필요한 정보로 응답합니다.
DPI2 서브에이전트는 필요하면 트랩을 보낼 준비도 되어 있습니다. 트랩을 보내면 SNMP 에이전트는 /etc/snmpdv3.conf 파일을 확인해 트랩을 전달할 IP 주소를 정하고 그 주소로 트랩을 보냅니다.
SMUX 피어
gated 같은 SMUX(SNMP Multiplexing) 피어는 시작할 때 TCP 199로 연결을 맺고 SMUX 연결을 초기화합니다.
초기화 뒤 SMUX 피어는 자기가 관리할 MIB 하위 트리를 등록합니다.
등록 뒤 SMUX 피어는 SMUX 서버에서 들어오는 요청을 받아 응답을 돌려보낼 준비가 됩니다. SMUX 피어는 요청을 받으면 처리해 SMUX 서버로 응답을 돌려보냅니다.
SMUX 피어도 SMUX 서버로 트랩을 보낼 수 있습니다. 트랩을 보내면 SNMP 에이전트는 /etc/snmpdv3.conf 파일을 확인해 트랩을 전달할 IP 주소를 정하고 그 주소로 트랩을 보냅니다.
SNMP 관리자
SNMP 관리자는 SNMPv1, SNMPv2c, SNMPv3와 호환되는 clsnmp를 실행합니다.
clsnmp 명령으로 get, get-next, get-bulk, set 같은 요청을 보냅니다. 요청은 SNMP 에이전트의 UDP 161로 보내지고, 그 뒤 SNMP 에이전트의 응답을 기다립니다.
참고: SNMP 관리자가 UDP 161이 아닌 포트를 쓰게 하려면 /etc/clsnmp.conf 파일의 targetAgent 필드에 쓸 포트 번호와 IP 주소를 선언해야 합니다. /etc/clsnmp.conf 파일에 관한 정보는 Files Reference의 clsnmp.conf File을 봅니다.
관리자는 UDP 162에서 SNMP 트랩을 기다릴 수도 있습니다. SNMP 에이전트의 /etc/snmpdv3.conf 파일에 관리자의 IP 주소가 지정되어 있으면 SNMP 관리자가 트랩을 받습니다.
MIB 변수
MIB 변수에 관한 정보는 Communications Programming Concepts의 Management Information Base, Terminology Related to Management Information Base Variables, Working with Management Information Base Variables, Management Information Base Database를 봅니다.
DPI2 서브에이전트나 smux 피어를 직접 구성하려면 /usr/samples/snmpd/smux와 /usr/samples/snmpd/dpi2 디렉터리를 봅니다.
영어 원문
SNMPv3 architecture
There are four main parts to the SNMPv3 architecture.
The interaction between these systems to provide the necessary data requested is depicted in the following figure:
This illustration shows and example of the SNMPv3 architecture. The DPI2 subagent, smux peer, SNMP manager, and SNMP agent are shown. In addition, how they communicate with each other is shown. request
response request
response/trap
trap clsnmp snmpdv3
UDP 161
UDP 162 DPI2 agent
smux server hostmibd
smux peer
TCP 199 request
response/trap gated dpiPortForTCP.0
Figure 29. The primary parts of the SNMPv3 architecture
SNMP agent
The SNMP agent receives requests from, and makes responses to, the SNMP manager.
In addition, the SNMP agent communicates with all DPI2 subagents and SMUX peers on the system. The SNMP agent manages some MIB variables, and all DPI2 subagents and SMUX peers register their MIB variables with the SNMP agent.
When clsnmp (the SNMP manager) issues a request, it is sent to UDP 161 on the SNMP agent. If the request is an SNMPv1 or SNMPv2c request, the SNMP agent will verify the community name and process the request. If the request is an SNMPv3 request, the SNMP agent will attempt to authenticate the user requesting the data and ensure that the user has the access permissions required to fulfill the request by using the authentication keys, and, if the encrypted version is running, privacy keys. If the SNMP agent cannot authenticate the user, or if the user does not have the correct access permissions to fulfill the request, the SNMP agent will not honor the request. For information on creating users in SNMPv3, see Creating users in SNMPv3.
If the user is authenticated and has the correct access permissions, the SNMP agent will fulfill the request. The SNMP agent will locate the MIB variables being requested. If the SNMP agent itself is managing the requested MIB variables, it will process the request and send a response back to the SNMP manager. If a DPI2 subagent or SMUX peer is managing the requested MIB variables, the SNMP agent will forward the request to the DPI2 subagent or SMUX peer on which the MIB variables are managed, allow it to process the request, and will then respond to the SNMP manager.
DPI2 subagents
A DPI2 subagent, such as hostmibd, communicates with the DPI2 agent, which, in SNMPv3, is part of the SNMP agent.
The DPI2 subagent sends responses and traps to the DPI2 agent through dpiPortForTCP.0. Because this is not a well-known port, the DPI2 subagent must first issue a request for the port number for dpiPortForTCP.0. This request is issued to UDP 161 on the SNMP agent, after which the SNMP agent responds to the DPI2 subagent with the port number for dpiPortForTCP.0. After the port number is received, the DPI2 subagent establishes a connection with the DPI2 agent using the port number given. The DPI2 subagent then registers its MIB subtrees with the DPI2 agent.
Note: To enable the SNMP Agent to listen on a port other than UDP 161, you must set the SNMP_PORT environment. There are two ways to set this variable:
- Method 1: Stop the DPI2 subagent and type the following commands: –
SNMP_PORT=<port_number> /usr/sbin/aixmibd -d 128–SNMP_PORT=<port_number> /usr/sbin/hostmibd -d 128–SNMP_PORT=<port_number> /usr/sbin/snmpmibd -d 128
where port_number is the number of the port that you want to use. After the commands have completed executing, start the DPI2 subagent.
- Method 2: Include the
SNMP_PORTvariable in the/etc/environmentfile and assign the new port value to it. Allow the aixmibd, hostmibd, snmpmibd, and snmpd daemons to run from/etc/rc.tcpipas is. In this method, you do not have to run the aixmibd, hostmibd, and snmpmibd commands from the command line.
After the connection is established and the MIB subtrees have been registered, the DPI2 subagent is ready to respond to requests received from the DPI2 agent. When a request is received, the DPI2 subagent processes the request and responds with the necessary information.
The DPI2 subagent is also ready to send traps, if necessary. When a trap is sent, the SNMP agent will check its /etc/snmpdv3.conf file to determine the IP address or addresses to which the trap must be forwarded to, and it will send the trap to those addresses.
SMUX peers
A SNMP Multiplexing (SMUX) peer, such as gated, when started, will establish the connection to TCP 199 and will initialize the SMUX association.
Following the initialization, the SMUX peer will register the MIB subtrees it is going to manage.
After the registration, the SMUX peer is ready to accept any incoming request from the SMUX server and send responses back. When the SMUX peer receives a request, it will process the request and send a response back the SMUX server.
The SMUX peer can also send a trap to the SMUX server. If a trap is sent, the SNMP agent will check the /etc/snmpdv3.conf file to determine the IP address or addresses to which the trap must be forwarded, and it will send the trap to those addresses.
SNMP manager
The SNMP manager runs clsnmp, which is compatible with SNMPv1, SNMPv2c, and SNMPv3.
Use the clsnmp command to issue a request, such as a get, get-next, get-bulk, or set request. The request is sent to UDP 161 on the SNMP agent, after which it waits for the response from the SNMP agent.
Note: To allow the SNMP Manager to use a port other than UDP 161, you need to declare the port number you want to use and the IP address in the targetAgent field of the /etc/clsnmp.conf file. For information on the /etc/clsnmp.conf file, see clsnmp.conf File in Files Reference.
It also can listen to SNMP traps on UDP 162. The SNMP manager will receive traps if its IP address is so specified in the /etc/snmpdv3.conf file on the SNMP agent.
MIB variables
Information on MIB variables can be found in the following locations.
For information on MIB variables, see Management Information Base, Terminology Related to Management Information Base Variables, Working with Management Information Base Variables, and Management Information Base Database in Communications Programming Concepts.
If you want to configure your own DPI2 subagent or smux peer, see the /usr/samples/snmpd/smux and /usr/samples/snmpd/dpi2 directories.
SNMPv3 인증 키
SNMPv3 요청을 처리하려면 대체로 인증이 필요합니다(요청한 보안 수준이 noAuth가 아니라면).
요청을 인증할 때 SNMP 에이전트는 SNMPv3 요청으로 보낸 인증 키로, 사용자에게 정의된 인증 키로 만든 메시지 다이제스트와 같은 메시지 다이제스트를 만들 수 있는지 확인합니다.
SNMP 관리자에서 요청을 보낼 때 clsnmp 명령은 SNMP 관리자의 /etc/clsnmp.conf 파일 항목에 있는 인증 키를 씁니다. 이 키는 SNMP 에이전트의 /etc/snmpdv3.conf 파일에서 그 사용자의 USM_USER 항목에 지정한 인증 키와 대응해야 합니다. 인증 키는 pwtokey 명령으로 만듭니다.
인증 키는 두 가지 정보로 만듭니다.
- 지정한 비밀번호
- 키를 쓸 SNMP 에이전트의 식별. 에이전트가 IBM 에이전트이고 engineID를 벤더 고유 engineID 공식으로 만들었다면 IP 주소나 호스트 이름으로 에이전트를 식별할 수 있습니다. 그렇지 않으면 에이전트 식별로 engineID를 줘야 합니다.
키를 쓸 에이전트의 식별을 포함한 키를 지역화 키(localized key)라고 합니다. 그 에이전트에서만 쓸 수 있습니다. 키를 쓸 에이전트의 engineID를 포함하지 않은 키를 비지역화 키(non-localized)라고 합니다.
clsnmp 명령의 구성 파일 /etc/clsnmp.conf에 저장하는 키는 비지역화 키여야 합니다. SNMP 에이전트의 구성 파일 /etc/snmpdv3.conf에 저장하는 키는 지역화 키나 비지역화 키 모두 될 수 있지만, 지역화 키가 더 안전하다고 봅니다.
클라이언트 구성 파일에 인증 키를 저장하는 대신, clsnmp 명령은 사용자 비밀번호를 저장할 수도 있습니다. clsnmp 명령에 비밀번호를 구성하면 코드가 사용자의 인증 키(요청하고 암호화 버전이 설치되어 있으면 암호 키도)를 만듭니다. 이 키는 에이전트의 /etc/snmpdv3.conf 파일의 USM_USER에 구성하거나 SNMP SET 명령으로 동적으로 구성한 키와 같은 인증 값을 만들어야 합니다. 그러나 클라이언트 구성 파일에 비밀번호를 쓰는 것은 구성 파일에 키를 쓰는 것보다 덜 안전하다고 봅니다.
영어 원문
SNMPv3 authentication keys
Authentication is generally required for SNMPv3 requests to be processed (unless the security level requested is noAuth).
When authenticating a request, the SNMP agent verifies that the authentication key sent in an SNMPv3 request can be used to create a message digest that matches the message digest created from the authentication key defined by the user.
When a request is issued from the SNMP manager, the clsnmp command uses the authentication key found on an entry in the /etc/clsnmp.conf file on the SNMP manager. It needs to correlate with the
authentication key specified on a USM_USER entry for that user in the SNMP agent's /etc/snmpdv3.conf file. Authentication keys are generated using the pwtokey command.
The authentication key is generated from two pieces of information:
The specified password
The identification of the SNMP agent at which the key will be used. If the agent is an IBM agent, and its engineID was generated using the vendor-specific engineID formula, the agent may be identified by IP address or host name. Otherwise, the engineID must be provided as the agent identification.
A key that incorporates the identification of the agent at which it will be used is called a localized key. It can be used only at that agent. A key that does not incorporate the engineID of the agent at which it will be used is called non-localized.
Keys stored in the clsnmp command's configuration file, /etc/clsnmp.conf, are expected to be non-localized keys. Keys stored in the SNMP agent's configuration file, /etc/snmpdv3.conf, can be either localized or non-localized, though using localized keys is considered more secure.
As an alternative to storing authentication keys in the client configuration file, the clsnmp command allows user passwords to be stored. If the clsnmp command is configured with a password, the code generates an authentication key (and a privacy key if requested, and if the encrypted version is installed) for the user. These keys must produce the same authentication values as the keys configured for the USM_USER in the agent's /etc/snmpdv3.conf file or configured dynamically with the SNMP SET commands. However, the use of passwords in the client configuration file is considered less secure that the use of keys in the configuration file.
SNMPv3 암호 키
암호화는 수출법이 허용하는 곳에서 AIX Expansion Pack의 별도 제품으로 쓸 수 있습니다. 암호화에 쓰는 키는 인증에 쓰는 것과 같은 알고리즘으로 만듭니다.
그러나 키 길이는 다를 수 있습니다. 예를 들어 HMAC-SHA 인증 키는 20바이트지만, HMAC-SHA와 함께 쓰는 지역화 암호 키는 16바이트뿐입니다.
암호화 버전은 설치하면 자동으로 활성화됩니다. 암호화하지 않는 버전으로 되돌리려면 snmpv3_ssw 명령을 씁니다.
영어 원문
SNMPv3 privacy keys
Encryption is available as a separate product on the AIX Expansion Pack where export laws allow. Keys used for encryption are generated using the same algorithms as those used for authentication.
However, key lengths may differ. For example, an HMAC-SHA authentication key is 20 bytes long, but a localized encryption key used with HMAC-SHA is only 16 bytes long.
The encrypted version is automatically activated after installation. To switch back to the non-encrypted version, use the snmpv3_ssw command.
SNMPv3 키 만들기
AIX는 pwtokey 명령으로 인증 키와 (해당하면) 암호 키를 만듭니다.
pwtokey 명령은 비밀번호를 지역화·비지역화 인증 키와 암호 키로 바꿉니다. pwtokey 절차는 비밀번호와 에이전트 식별자를 받아 인증 키와 암호 키를 만듭니다. pwtokey 명령이 쓰는 절차는 clsnmp 명령이 쓰는 것과 같은 알고리즘이므로, SNMP 에이전트를 구성하는 사람은 주어진 비밀번호와 대상이 실행될 IP 주소로 SNMP 관리자의 /etc/clsnmp.conf 파일에 넣을 사용자의 알맞은 인증 키(와 암호 키)를 만들 수 있습니다.
인증 키(암호화 버전을 실행한다면 암호 키도)를 만든 뒤에는 그 키를 SNMP 에이전트의 /etc/snmpdv3.conf 파일과 SNMP 관리자의 /etc/clsnmp.conf 파일에 넣어야 합니다.
SNMPv3에는 가능한 사용자 구성이 아홉 가지 있습니다. 각 구성과 그 예는 아래와 같습니다. 이 키들은 비밀번호로 defaultpassword를, IP 주소로 9.3.149.49를 써서 만들었습니다. 다음 명령을 썼습니다.
pwtokey -u all -p all defaultpassword 9.3.149.49
다음 인증 키와 암호 키가 만들어졌습니다.
Display of 16 byte HMAC-MD5 authKey:
18a2c7b78f3df552367383eef9db2e9f
Display of 16 byte HMAC-MD5 localized authKey:
a59fa9783c04bcbe00359fb1e181a4b4
Display of 16 byte HMAC-MD5 privKey:
18a2c7b78f3df552367383eef9db2e9f
Display of 16 byte HMAC-MD5 localized privKey:
a59fa9783c04bcbe00359fb1e181a4b4
Display of 20 byte HMAC-SHA authKey:
754ebf6ab740556be9f0930b2a2256ca40e76ef9
Display of 20 byte HMAC-SHA localized authKey:
cd988a098b4b627a0e8adc24b8f8cd02550463e3
Display of 20 byte HMAC-SHA privKey:
754ebf6ab740556be9f0930b2a2256ca40e76ef9
Display of 16 byte HMAC-SHA localized privKey:
cd988a098b4b627a0e8adc24b8f8cd02
이 항목들은 /etc/snmpdv3.conf 파일에 들어갑니다. 가능한 구성 아홉 가지는 다음과 같습니다.
- HMAC-MD5 프로토콜을 쓰는 지역화 인증 키와 암호 키:
USM_USER user1 - HMAC-MD5 a59fa9783c04bcbe00359fb1e181a4b4 DES a59fa9783c04bcbe00359fb1e181a4b4 L - -
- HMAC-MD5 프로토콜을 쓰는 비지역화 인증 키와 암호 키:
USM_USER user2 - HMAC-MD5 18a2c7b78f3df552367383eef9db2e9f DES 18a2c7b78f3df552367383eef9db2e9f N - -
- HMAC-MD5 프로토콜을 쓰는 지역화 인증 키:
USM_USER user3 - HMAC-MD5 a59fa9783c04bcbe00359fb1e181a4b4 - - L -
- HMAC-MD5 프로토콜을 쓰는 비지역화 인증 키:
USM_USER user4 - HMAC-MD5 18a2c7b78f3df552367383eef9db2e9f - - N -
- HMAC-SHA 프로토콜을 쓰는 지역화 인증 키와 암호 키:
USM_USER user5 - HMAC-SHA cd988a098b4b627a0e8adc24b8f8cd02550463e3 DES
cd988a098b4b627a0e8adc24b8f8cd02 L -
- HMAC-SHA 프로토콜을 쓰는 비지역화 인증 키와 암호 키:
USM_USER user6 - HMAC-SHA 754ebf6ab740556be9f0930b2a2256ca40e76ef9 DES
754ebf6ab740556be9f0930b2a2256ca40e76ef9 N -
- HMAC-SHA 프로토콜을 쓰는 지역화 인증 키:
USM_USER user7 - HMAC-SHA cd988a098b4b627a0e8adc24b8f8cd02550463e3 - - L -
- HMAC-SHA 프로토콜을 쓰는 비지역화 인증 키:
USM_USER user8 - HMAC-SHA 754ebf6ab740556be9f0930b2a2256ca40e76ef9 - - N -
- 인증 키도 암호 키도 쓰지 않음(SNMPv1):
USM_USER user9 - none - none - - -
SNMPv3에서 사용자를 구성하려면 /etc/snmpdv3.conf 파일과 /etc/clsnmp.conf 파일을 모두 구성해야 합니다. 사용자 키를 만들고 필요한 구성 파일을 편집하는 시나리오는 Creating users in SNMPv3를 봅니다. 또 Commands Reference, Volume 4의 pwtokey 명령, Commands Reference, Volume 1의 clsnmp 명령, Files Reference의 /etc/clsnmp.conf와 /etc/snmpdv3.conf 파일 형식을 봅니다. /usr/samples/snmpdv3 디렉터리에 있는 snmpdv3.conf와 clsnmp.conf 예제 구성 파일도 참고할 수 있습니다.
영어 원문
SNMPv3 generating keys
AIX uses the pwtokey command to generate authentication and, when applicable, privacy keys.
The pwtokey command enables the conversion of passwords into localized and non-localized authentication and privacy keys. The pwtokey procedure takes a password and an identifier as the agent and generates authentication and privacy keys. Because the procedure used by the pwtokey command is the same algorithm used by the clsnmp command, the person configuring the SNMP agent can generate appropriate authentication (and privacy) keys to put into the /etc/clsnmp.conf file on the SNMP manager for a user, given a particular password and the IP address at which the target will run on.
After you have generated the authentication keys (and privacy keys if you are running the encrypted version), you will need to enter those keys in the /etc/snmpdv3.conf file on the SNMP agent and in the /etc/clsnmp.conf file on the SNMP manager.
In SNMPv3, there are nine possible user configurations. Each possible configuration, along with an example of each, is given below. These particular keys were generated using defaultpassword for the password and 9.3.149.49 as the IP address. The following command was used:
pwtokey -u all -p all defaultpassword 9.3.149.49
The following authentication and privacy keys were generated:
(16줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
These entries would appear in the /etc/snmpdv3.conf file. The following nine configurations are possible:
- Localized authentication and privacy keys using the HMAC-MD5 protocol:
USM_USER user1 - HMAC-MD5 a59fa9783c04bcbe00359fb1e181a4b4 DES a59fa9783c04bcbe00359fb1e181a4b4 L - -
- Non-localized authentication and privacy keys using the HMAC-MD5 protocol:
USM_USER user2 - HMAC-MD5 18a2c7b78f3df552367383eef9db2e9f DES 18a2c7b78f3df552367383eef9db2e9f N - -
- Localized authentication key using the HMAC-MD5 protocol:
USM_USER user3 - HMAC-MD5 a59fa9783c04bcbe00359fb1e181a4b4 - - L -
- Non-localized authentication key using the HMAC-MD5 protocol:
USM_USER user4 - HMAC-MD5 18a2c7b78f3df552367383eef9db2e9f - - N -
- Localized authentication and privacy keys using the HMAC-SHA protocol:
USM_USER user5 - HMAC-SHA cd988a098b4b627a0e8adc24b8f8cd02550463e3 DES
cd988a098b4b627a0e8adc24b8f8cd02 L -
- Non-localized authentication and privacy keys using the HMAC-SHA protocol:
USM_USER user6 - HMAC-SHA 754ebf6ab740556be9f0930b2a2256ca40e76ef9 DES
754ebf6ab740556be9f0930b2a2256ca40e76ef9 N -
- Localized authentication key using the HMAC-SHA protocol:
USM_USER user7 - HMAC-SHA cd988a098b4b627a0e8adc24b8f8cd02550463e3 - - L -
- Non-localized authentication key using the HMAC-SHA protocol:
USM_USER user8 - HMAC-SHA 754ebf6ab740556be9f0930b2a2256ca40e76ef9 - - N -
- Neither authentication nor privacy keys used (SNMPv1)
USM_USER user9 - none - none - - -
Configuring users in SNMPv3 requires configuration of both the /etc/snmpdv3.conf file and the /etc/clsnmp.conf file. For a scenario on generating user keys and editing the necessary configuration files, see Creating users in SNMPv3. In addition, see the pwtokey command in Commands Reference, Volume 4 and the clsnmp command in Commands Reference, Volume 1, and the file formats for the /etc/clsnmp.conf file and /etc/snmpdv3.conf file in Files Reference. You can also refer to the sample snmpdv3.conf configuration file and clsnmp.conf configuration file located in the /usr/samples/snmpdv3 directory.
SNMPv3 키 갱신
SNMPv3는 새 비밀번호를 바탕으로 사용자 키를 동적으로 갱신하는 기능을 제공합니다.
pwchange 명령으로 바뀐 비밀번호를 바탕으로 새 사용자 키를 만들고, clsnmp 명령으로 /etc/snmpdv3.conf 파일의 사용자 키를 동적으로 갱신하고, /etc/clsnmp.conf 파일을 새 키로 편집해 합니다. 이 과정에서 새 비밀번호는 기계 사이에 전달되지 않습니다.
사용자 키 갱신의 단계별 지시는 아래 SNMPv3 인증·암호 키 동적 갱신을 봅니다. 또 Commands Reference, Volume 4의 pwchange 명령, Commands Reference, Volume 1의 clsnmp 명령, Files Reference의 /etc/clsnmp.conf와 /etc/snmpdv3.conf 파일 형식을 봅니다.
영어 원문
SNMPv3 updating keys
SNMPv3 offers the capability of updating user keys based on new passwords dynamically.
This is done by using the pwchange command to generate new user keys based on an updated password, using the clsnmp command to dynamically update the user key in the /etc/snmpdv3.conf file, and editing the /etc/clsnmp.conf file with the new keys. During this process, the new password is never communicated between machines.
For step-by-step instructions on updating user keys, see “Dynamically updating authentication and privacy keys in SNMPv3.” In addition, refer to the pwchange coomand in Commands Reference, Volume 4 and the clsnmp command in Commands Reference, Volume 1, and the /etc/clsnmp.conf file format and /etc/snmpdv3.conf file format in Files Reference.
SNMPv3 인증·암호 키 동적 갱신
이 시나리오는 SNMPv3에서 사용자의 인증 키를 동적으로 갱신하는 방법을 보여 줍니다.
이 시나리오에서는 사용자 u4가 사용자 u8의 인증 키를 갱신합니다. 사용자 u4와 u8 모두 비밀번호 defaultpassword와 IP 주소 9.3.149.49로 인증 키를 이미 만들었고 모든 것이 동작하고 있습니다.
이 시나리오에서 사용자 u8의 새 키를 만들고 /etc/snmpdv3.conf 파일을 동적으로 갱신합니다. 그런 다음 관리자 쪽 /etc/clsnmp.conf 파일의 사용자 u8 인증 키를 새 키로 직접 고쳐야 합니다.
이 절차를 시작하기 전에 SNMP 에이전트의 /etc/snmpdv3.conf 파일과 SNMP 관리자의 /etc/clsnmp.conf 파일을 백업합니다.
다음은 동적으로 갱신할 /etc/snmpdv3.conf 파일입니다.
USM_USER u4 - HMAC-MD5 18a2c7b78f3df552367383eef9db2e9f - - N -
USM_USER u8 - HMAC-SHA 754ebf6ab740556be9f0930b2a2256ca40e76ef9 - - N -
VACM_GROUP group1 SNMPv1 public -
VACM_GROUP group2 USM u4 -
VACM_GROUP group2 USM u8 -
VACM_VIEW defaultView internet - included -
VACM_ACCESS group1 - - noAuthNoPriv SNMPv1 defaultView - defaultView -
VACM_ACCESS group2 - - noAuthNoPriv USM defaultView defaultView defaultView -
VACM_ACCESS group2 - - AuthNoPriv USM defaultView defaultView defaultView -
VACM_ACCESS group2 - - AuthPriv USM defaultView defaultView defaultView -
NOTIFY notify1 traptag trap -
TARGET_ADDRESS Target1 UDP 127.0.0.1 traptag trapparms1 - - -
TARGET_ADDRESS Target2 UDP 9.3.149.49 traptag trapparms2 - - -
TARGET_ADDRESS Target3 UDP 9.3.149.49 traptag trapparms3 - - -
TARGET_ADDRESS Target4 UDP 9.3.149.49 traptag trapparms4 - - -
TARGET_PARAMETERS trapparms1 SNMPv1 SNMPv1 public noAuthNoPriv -
TARGET_PARAMETERS trapparms3 SNMPv2c SNMPv2c publicv2c noAuthNoPriv -
TARGET_PARAMETERS trapparms4 SNMPv3 USM u4 AuthNoPriv -
다음은 사용자 u8을 위해 갱신할 /etc/clsnmp.conf 파일입니다.
testu4 9.3.149.49 snmpv3 u4 - - AuthNoPriv HMAC-MD5 18a2c7b78f3df552367383eef9db2e9f - -
testu8 9.3.149.49 snmpv3 u8 - - AuthNoPriv HMAC-SHA 754ebf6ab740556be9f0930b2a2256ca40e76ef9 - -
생각할 점
- 이 시나리오의 정보는 특정 AIX 버전으로 시험했습니다. 얻는 결과는 AIX 버전과 수준에 따라 크게 다를 수 있습니다.
비밀번호와 인증 키 갱신
/etc/snmpd.conf 파일의 커뮤니티 이름은 /etc/snmpdv3.conf 파일의 VACM_GROUP 항목의 일부가 됩니다. 각 커뮤니티는 그룹에 넣어야 합니다. 그런 다음 그룹에 필요한 뷰와 접근 권한을 줍니다. (이 문단은 원문이 이전 시나리오에서 그대로 가져온 것으로 보입니다.)
- SNMP 관리자 쪽에서 pwchange 명령을 실행합니다. 이 시나리오에서는 다음 명령을 실행했습니다.
pwchange -u auth -p HMAC-SHA defaultpassword newpassword 9.3.149.49
이 명령은 새 인증 키를 만듭니다.
-u auth는 인증 키만 만든다는 뜻입니다. 암호 키도 갱신한다면-u all을 씁니다.-p HMAC-SHA는 인증 키를 만드는 데 쓸 프로토콜을 지정합니다. 암호 키도 갱신한다면-p all을 씁니다.defaultpassword는 최신 인증 키를 만드는 데 쓴 비밀번호입니다(예를 들어 최신 인증 키를bluepen으로 만들었다면 여기서도bluepen을 씁니다).newpassword는 인증 키를 만드는 데 쓸 새 비밀번호입니다. 나중을 위해 이 비밀번호를 보관합니다.9.3.149.49는 SNMP 에이전트가 실행되는 IP 주소입니다.
이 명령은 다음 출력을 냈습니다.
Dump of 40 byte HMAC-SHA authKey keyChange value:
8173701d7c00913af002a3379d4b150a
f9566f56a4dbde21dd778bb166a86249
4aa3a477e3b96e7d
이 인증 키는 다음 단계에서 씁니다.
참고: 쓰는 새 비밀번호는 안전한 곳에 보관합니다. 나중에 바꿀 때 다시 써야 합니다.
2. SNMP 관리자에서 사용자 u4가 다음 명령을 입력해 사용자 u8의 인증 키를 바꿉니다.
clsnmp -h testu4 set usmUserAuthKeyChange.12.0.0.0.2.0.0.0.0.9.3.149.49.2.117.56
\’8173701d7c00913af002a3379d4b150af9566f56a4dbde21dd778bb166a862494aa3a477e3b96e7d\’h
/etc/clsnmp.conf파일에서 사용자u4에 대응하므로testu4를 씁니다.usmUserAuthKeyChange의 인스턴스 ID에는 갱신이 일어나는 SNMP 에이전트의 엔진 ID와, 인증 키를 갱신하는 사용자 이름이 십진 값으로 들어 있습니다. 엔진 ID는/etc/snmpd.boots파일에 있습니다(/etc/snmpd.boots파일에는 숫자열이 둘 있습니다. 첫째가 엔진 ID입니다. 둘째 숫자열은 무시합니다). 여기서 쓰려면 엔진 ID를 16진수에서 십진수로 바꿔야 합니다. 16진수 엔진 ID의 두 자리마다 십진 값 하나가 됩니다. 예를 들어 엔진 ID000000020000000009039531은00 00 00 02 00 00 00 00 09 03 95 31로 읽습니다. 각 수를 십진 값으로 바꾸면0.0.0.2.0.0.0.0.9.3.149.49가 됩니다(변환표는 ASCII, decimal, hexadecimal, octal, and binary conversion table 참고). 문자열 맨 앞의 수는 십진 문자열의 바이트 수입니다. 이 경우12이므로12.0.0.0.2.0.0.0.0.9.3.149.49가 됩니다. 그다음 수는 사용자 이름의 바이트 수이고, 그 뒤에 사용자 이름 자체의 십진 값이 옵니다. 이 경우 사용자 이름은u8입니다. 십진 값으로 바꾸면u8은117.56이 됩니다. 사용자 이름이 2바이트이므로 사용자 이름을 나타내는 값은2.117.56이 됩니다. 이것을 십진 엔진 ID 끝에 붙입니다. 이 경우 결과는12.0.0.0.2.0.0.0.0.9.3.149.49.2.117.56입니다.- 명령의 다음 값은 앞 단계에서 pwchange 명령으로 만든 새 인증 키입니다.
참고: 사용자에게 암호 키도 구성되어 있으면 암호 키를 갱신하도록 이 절차를 되풀이해야 합니다. 암호 키를 갱신할 때는
usmUserAuthKeyChange대신usmUserPrivKeyChange값을 씁니다.usmUserAuthKeyChange대신usmUserOwnAuthKeyChange를 쓰면 사용자가 자기 인증 키를 바꿀 수 있습니다. 예를 들어 사용자u4는usmUserOwnAuthKeyChange로 자기 인증 키를 바꿀 수 있습니다. 명령 출력은 다음과 같습니다.
1.3.6.1.6.3.15.1.2.2.1.6.12.0.0.0.2.0.0.0.0.9.3.149.49.2.117.56 = ’8173701d7c00913af002a3379
d4b150af9566f56a4dbde21dd778bb166a862494aa3a477e3b96e7d’h
이 명령이 끝나면 SNMP 에이전트 쪽의 /etc/snmpdv3.conf 파일이 5분 뒤 자동으로 갱신됩니다. SNMP 데몬을 멈췄다 시작해 파일을 갱신할 수도 있습니다. /etc/snmpdv3.conf 파일의 사용자 u8 항목이 다음과 같이 동적으로 갱신됩니다.
USM_USER u8 000000020000000009039531 HMAC-SHA 4be657b3ae92beee322ee5eaeef665b338caf2d9
None - L nonVolatile
- SNMP 관리자 쪽에서 pwtokey 명령을 실행해 새 비밀번호를 바탕으로
/etc/clsnmp.conf파일에 넣을 새 인증 키를 만듭니다. 이 시나리오에서는 다음 명령을 실행했습니다.
pwtokey -u auth -p HMAC-SHA newpassword 9.3.149.49
-u auth는 인증 키만 만든다는 뜻입니다. 암호 키도 갱신한다면-u all을 씁니다.-p HMAC-SHA는 인증 키를 만드는 데 쓸 프로토콜을 지정합니다. 암호 키도 갱신한다면-p all을 씁니다.- 쓴 비밀번호(이 경우
newpassword)는 pwchange 명령으로 새 인증 키를 만들 때 쓴 비밀번호와 같아야 합니다. - 쓴 IP 주소(이 경우
9.3.149.49)는 에이전트가 실행되는 IP 주소여야 합니다.
결과로 지역화와 비지역화 인증 키가 나옵니다.
Display of 20 byte HMAC-SHA authKey:
79ce23370c820332a7f2c7840c3439d12826c10d
Display of 20 byte HMAC-SHA localized authKey:
b07086b278163a4b873aace53a1a9ca250913f91
- 좋아하는 텍스트 편집기로
/etc/clsnmp.conf파일을 열고, 키를 갱신하는 사용자의 줄에 비지역화 인증 키를 넣습니다. 이 시나리오에서 항목은 다음과 같습니다.
testu8 9.3.149.49 snmpv3 u8 - - AuthNoPriv HMAC-SHA 79ce23370c820332a7f2c7840c3439d12826c10d - -
파일을 저장하고 닫습니다. 5. 다음 명령을 실행해 갱신한 구성을 시험합니다.
clsnmp -v -h testu8 walk mib
여기서 mib는 사용자 u8이 읽기 접근 권한을 가진 MIB 변수입니다. 이 경우 사용자 u8은 internet에 접근할 수 있습니다.
영어 원문
Dynamically updating authentication and privacy keys in SNMPv3
This scenario shows how to dynamically update the authentication keys for a user in SNMPv3.
In this scenario, user u4 will update the authentication keys for user u8. Both users u4 and u8 have already had authentication keys created based on password defaultpassword and IP address 9.3.149.49, and everything is working.
During this scenario, new keys will be created for user u8 and the /etc/snmpdv3.conf file will be dynamically updated. The authentication key for user u8 in the manager side's /etc/clsnmp.conf file will then need to be manually edited to reflect the new keys.
Make a backup of the /etc/snmpdv3.conf file on the SNMP agent and a backup of the /etc/clsnmp.conf file on the SNMP manager before you start this procedure.
Below is the /etc/snmpdv3.conf file that will be dynamically updated:
(18줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
Below is the /etc/clsnmp.conf file that will be updated for user u8:
testu4 9.3.149.49 snmpv3 u4 - - AuthNoPriv HMAC-MD5 18a2c7b78f3df552367383eef9db2e9f - -
testu8 9.3.149.49 snmpv3 u8 - - AuthNoPriv HMAC-SHA 754ebf6ab740556be9f0930b2a2256ca40e76ef9 - -
Things to consider
- The information in this how-to scenario was tested using specific versions of AIX. The results you obtain might vary significantly depending on your version and level of AIX.
Update your password and authentication keys
The community names in the /etc/snmpd.conf file become part of the VACM_GROUP entries in the /etc/snmpdv3.conf file. Each community must be placed in a group. You will then give the groups the view and access permissions needed.
- On the SNMP manager side, run the pwchange command. In this scenario, we ran the following command:
pwchange -u auth -p HMAC-SHA defaultpassword newpassword 9.3.149.49
This command will generate a new authentication key.
-u authspecifies that only an authentication key will be created. If you are updating privacy keys as well, use-u all.-p HMAC-SHAspecifies the protocol that will be used to create the authentication key. If you are updating privacy keys as well, us-p all.defaultpasswordis the password used to create the latest authentication key (for example, ifbluepenwould have been used to create the latest authentication key,bluepenwould be used here as well)newpasswordis the new password that will be used to generate the authentication key. Keep this password for future reference9.3.149.49is the IP address where the SNMP agent is running.
This command produced the following output:
Dump of 40 byte HMAC-SHA authKey keyChange value:
8173701d7c00913af002a3379d4b150a
f9566f56a4dbde21dd778bb166a86249
4aa3a477e3b96e7d
You will use this authentication key in the next step.
Note: Keep the new passwords you use in a safe place. You will need to use them again when making changes in the future.
- On the SNMP manager, user
u4will change the authentication key for useru8by entering the following command:
clsnmp -h testu4 set usmUserAuthKeyChange.12.0.0.0.2.0.0.0.0.9.3.149.49.2.117.56
\’8173701d7c00913af002a3379d4b150af9566f56a4dbde21dd778bb166a862494aa3a477e3b96e7d\’h
testu4is used because it is mapped to useru4in the/etc/clsnmp.conffile.The instance ID of
usmUserAuthKeyChangeincludes, in decimal values, the engine ID of the SNMP agent where the update is taking place and username whose authentication key is being updated. The engine ID can be found in the/etc/snmpd.bootsfile (the/etc/snmpd.bootsfile contains two strings of numbers. The engine ID is the first string. Ignore the second string of numbers). The engine ID will need to be converted from hexadecimal values to decimal values in order to be used here. Each two numbers in the hexadecimal engine ID convert to one decimal value. For example, engine ID000000020000000009039531would be read as00 00 00 02 00 00 00 00 09 03 95 31. Each of those numbers must be converted to decimal values, resulting in,0.0.0.2.0.0.0.0.9.3.149.49(For a conversion table, see ASCII, decimal, hexadecimal, octal, and binary conversion table.). The first number in the string is the number of bytes in the decimal string. In this case, it is12, resulting in12.0.0.0.2.0.0.0.0.9.3.149.49. The following number is the number of bytes in the username, followed by the decimal values for the username itself. In this case, the username isu8. When converted to decimal values,u8becomes117.56. Because the username is 2 bytes long, the value representing the username becomes2.117.56. Add that to the end of the decimal engine ID (For a conversion table, see ASCII, decimal, hexadecimal, octal, and binary conversion table.). In this case, the result is12.0.0.0.2.0.0.0.0.9.3.149.49.2.117.56.The next value in the command is the new authentication key generated using the pwchange command in the previous step.
Note: If the user also has privacy keys configured, this procedure must be repeated to update the privacy keys. When updating the privacy keys, use the usmUserPrivKeyChange value instead of the usmUserAuthKeyChange value.
Using usmUserOwnAuthKeyChange instead of usmUserAuthKeyChange will allow a user to change his or her own authentication key. For example, user u4 could change its own authentication key using usmUserOwnAuthKeyChange. The output of the command follows:
1.3.6.1.6.3.15.1.2.2.1.6.12.0.0.0.2.0.0.0.0.9.3.149.49.2.117.56 = ’8173701d7c00913af002a3379
d4b150af9566f56a4dbde21dd778bb166a862494aa3a477e3b96e7d’h
After this command is completed, the /etc/snmpdv3.conf file will be automatically updated after five minutes on the SNMP agent side. You can also stop and start the SNMP daemon to update the file. The following entry for user u8 will be dynamically updated in the /etc/snmpdv3.conf file:
USM_USER u8 000000020000000009039531 HMAC-SHA 4be657b3ae92beee322ee5eaeef665b338caf2d9
None - L nonVolatile
- On the SNMP manager side, run the pwtokey command to generate the new authentication key based on the new password to place in the
/etc/clsnmp.conffile. In this scenario, we ran the following command:
pwtokey -u auth -p HMAC-SHA newpassword 9.3.149.49
-u authspecifies that only an authentication key will be created. If you are updating privacy keys as well, use-u all.-p HMAC-SHAspecifies the protocol that will be used in creating the authentication key. If you are updating privacy keys as well, use-p all.The password used (in this case
newpassword) must be the same as the password used when generating new authentication keys with the pwchange command.The IP address used (in this case
9.3.149.49) must be the IP address where the agent is running. The result gives the localized and non-localized authentication keys:
Display of 20 byte HMAC-SHA authKey:
79ce23370c820332a7f2c7840c3439d12826c10d
Display of 20 byte HMAC-SHA localized authKey:
b07086b278163a4b873aace53a1a9ca250913f91
- Open the
/etc/clsnmp.conffile with your favorite text editor and place the non-localized authentication key in the line for the user whose keys are being updated. In this scenario, the entry is as follows:
testu8 9.3.149.49 snmpv3 u8 - - AuthNoPriv HMAC-SHA 79ce23370c820332a7f2c7840c3439d12826c10d - -
Save and close the file.
- Test the updated configuration by running the following command:
clsnmp -v -h testu8 walk mib
where mib is a MIB variable to which user u8 has read access. In this case, user u8 has access to internet.
SNMPv3 요청
clsnmp 명령은 로컬이나 원격 호스트의 SNMP 에이전트에 SNMP 요청을 보내는 데 씁니다.
요청은 SNMPv1, SNMPv2c, SNMPv3 요청일 수 있습니다. 요청을 처리하려면 /etc/clsnmp.conf 파일이 구성되어 있어야 합니다.
clsnmp 명령은 get, getnext, getbulk, set, walk, findname 요청을 보낼 수 있습니다. 각 요청의 간단한 설명은 다음과 같습니다.
| 요청 | 설명 |
|---|---|
| get | MIB 변수 하나에서 데이터를 모읍니다. |
| getnext | MIB 하위 트리에서 다음 MIB 변수를 줍니다. |
| getbulk | 여러 MIB 하위 트리의 모든 MIB 변수를 줍니다. |
| set | MIB 변수를 설정합니다. |
| walk | 하위 트리 하나의 모든 MIB 변수를 줍니다. |
| findname | OID를 변수 이름에 대응시킵니다. |
| trap | clsnmp가 포트 162에서 트랩을 기다리게 합니다. |
clsnmp 요청을 보내는 자세한 방법은 Commands Reference, Volume 1의 clsnmp 명령을 봅니다.
영어 원문
SNMPv3 requests
The clsnmp command is used to send SNMP requests to SNMP agents on local or remote hosts.
The requests can be SNMPv1, SNMPv2c, or SNMPv3 requests. In order to process requests, the /etc/clsnmp.conf file must be configured.
The clsnmp command can issue get, getnext, getbulk, set, walk, and findname requests. Each of these requests is briefly described below:
get allows the user to gather data from one MIB variable
getnext
gives the next MIB variable in the MIB subtree
getbulk
gives all MIB variables from multiple MIB subtrees
set allows the user to set a MIB variable
walk gives all MIB variables of one subtree
findname
maps the OID to the variable name
trap allows clsnmp to listen to traps on port 162
For detailed information on issuing clsnmp requests, see the clsnmp command in Commands Reference, Volume 1.