К основному контенту

ipmi

ipmi сброс пароля и прочее

Применимость: Выделенный сервер с поддержкой IPMI
Слова для поиска: пароль, password KVM, КВМ, IPMIView, дедик, dedicated, supermicro

Задача:

Нужно получить доступ к виртуальной консоли KVM для управления сервером.

Решение:

Сброс пароля с помощью impicfg на MB Supermicro

Утилита impicfg доступна для разных операционных систем - Linux, Windows, DOS на сервере supermicro
impicfg может сбросить пароль к заводским установкам и менять многие параметры используя nехнологию IPMI .
Следует отметить, что во многих случаях для старых версий IPMI будут сброшены и сетевые настройки сброшены! Вы можете потерять доступ вообще. Поэтому рекомендуется перед сбросом сохранить сведения о настройке сети.
Для установки под Linux нужно скачать архив, распаковать и дать разрешение на выполнение соотвествующему файлу, например:
chmod +x ipmicfg-linux.x86_64.static
И создайте символическую ссылку для удобства использования
ln -s $(pwd)/ipmicfg-linux.x86_64.static /usr/local/sbin/ipmicfg
В архиве для Windows можно использовать исполняемый файл ipmicfg-win.exe.

Шаг 1: Получение текущей конфигурации сети и установка новых параметров

root@(none):~# ipmicfg -m
IP=10.10.10.183 MAC=00:25:90:19:78:5A
root@(none):~# ipmicfg -k
Net Mask=255.255.255.0
root@(none):~# ipmicfg -g
IP=10.10.10.1

Шаг 2: сброс к заводским установкам

root@(none):~# ipmicfg -fd
Reset to the factory default completed!

Шаг 3: Проверьте настройки сети и измените при необходимости

root@(none):~# ipmicfg -m
IP=10.10.10.183 MAC=00:25:90:19:78:5A
root@(none):~# ipmicfg -k
Net Mask=255.255.255.0
root@(none):~# ipmicfg -g
IP=10.10.10.1
Установка новых параметров:
 root@(none):~# ipmicfg -m 10.10.10.183
IP=10.10.10.183
root@(none):~# ipmicfg -k 255.255.255.0
Net Mask=255.255.255.0
root@(none):~# ipmicfg -g 10.10.10.1
Gateway IP=10.10.10.1

Пароль IPMI

После сброса к заводским установкам вы можеет использовать такие значения:
  • Пользователь: ADMIN
  • Пароль: ADMIN

Добавление пользователя

Вы можете не сбрасывая настроек добавить нового пользователя с наивысшим уровнем привилегий, затем зайти через IPMIView и сделать все необходимое.
Получить список пользователей:
ipmicfg -user list
Maximum number of Users          : 10
Count of currently enabled Users : 3
User ID | User Name        | Privilege Level | Enable
------- | -----------      | --------------- | ------
      2 | ADMIN            | Administrator   | Yes   
      3 | user           | Operator        | Yes
Синтаксис команды:
ipmicfg -user add <user id> <user name> <password> <privilege>
Например:
ipmicfg -user add 4 user2 HFlUYdS45 4
Проверяем:
ipmicfg -user list
Maximum number of Users          : 10
Count of currently enabled Users : 4
User ID | User Name        | Privilege Level | Enable
------- | -----------      | --------------- | ------
      2 | ADMIN            | Administrator   | Yes   
      3 | user             | Operator        | Yes   
      4 | user2            | Administrator   | Yes

IPMITOOL

Пользователи серверов под Linux или FreeBSD могут использовать утилиту ipmitool
[root@ad0122 ~]# ipmitool user 
User Commands: summary [<channel number>]
                   list    [<channel number>]
                   set name     <user id> <username>
                   set password <user id> [<password>]
                   disable      <user id>
                   enable       <user id>
                   priv         <user id> <privilege level> [<channel number>]
                   test         <user id> <16|20> [<password]>
ВНИМАНИЕ! Для работы этой утилиты должен быть загружен модуль IPNMAC

Смотрите также:

Комментарии

Популярные сообщения из этого блога

How to do Arithmetic Operations in Ansible

You can use arithmetic calculations in Ansible using the Jinja syntax. This is helpful in many situations where you have stored the output of an operation, and you need to manipulate that value. All usual operation like addition, subtraction, multiplication, division, and modulo are possible. Let us start with an example. We will be using the  debug module  to print the out the result. The following tasks show all the basic arithmetic operations. The output is given in comments. Ansible arithmetic operation example - hosts: loc tasks: - debug: msg: "addition{{ 4 +3 }}" #Ansible addition 7 - debug: msg: "substraction {{ 4 - 3 }}" #Ansible arithmetic substraction 1 - debug: msg: "multiplication {{ 4 * 3 }}" #multiplication 12 - debug: msg: "Modulo operation {{ 7 % 4}}" #ansible Modulo operation - find remainder 3 - debug: msg: "floating division {{ 4 / 3}}" #ansible floating divisio...

ubuntu/debian ipmi

#install ipmitool (this is for debian) apt-get install ipmitool #insert the kernel modules needed for ipmi modprobe ipmi_devintf modprobe ipmi_si modprobe ipmi_msghandler #get the current mode (01 00 is dedicated mode) ipmitool raw 0x30 0x70 0x0c 0 #send the raw command to enable dedicated lan ipmitool raw 0x30 0x70 0xc 1 1 0
Ansible - Appending to lists and dictionaries  n this blog post I'll show how to add items to lists and dictionaries, when using loops, and across tasks. Normally when trying to add a new item to the variable, while in the loop, or between tasks, Ansible will ovewrite the values, keeping the result of the last iteration. For example, let's see what will be the result of running the following playbook: --- - name: Append to list hosts: localhost vars: cisco: - CiscoRouter01 - CiscoRouter02 - CiscoRouter03 - CiscoSwitch01 arista: - AristaSwitch01 - AristaSwitch02 - AristaSwitch03 tasks: - name: Add Cisco and Airsta devices to the list set_fact: devices: "{{ item }}" with_items: - "{{ cisco }}" - "{{ arista }}" - name: Debug list debug: var: devices verbosity: 0 [przemek@quasar blog]$ ansible-playbook append_list.yml PLAY [Append to list] ****************...