Intel AMT の Serial over LAN を Linux で使ってみる
概要
vPro 対応の ThinkPad を持っていたので、 Intel AMT を使って Serial-over-LAN(SOL) をやってみた。 リモートで BIOS の設定も可能。 2017年になって Intel AMT の脆弱性が発見されたので、 Intel AMT のファームウェアのアップデートは必須。 (おそらく、同じセグメントに信頼できるホストしか居ない場合は問題ない。) Intel AMT のファームウェアのアップデートは Windows じゃないとできなさそう。
Intel AMT の設定
起動時の ThinkPad ロゴマーク表示しているときにに Enter を押してから Ctrl-P を押してから以下のように設定する。 (今回は SOL のみの設定。)
- 大文字小文字数字を絡めたパスワードの設定。 (例: P@ssw0rd)
- IP とマスクの設定 (例: 192.168.xx.xx/255.255.255.0)
- Manageability Feature Selection -> Enabled
- SOL -> Enabled
- Legacy Redirection Mode -> Enabled
- User Consent -> Disabled
Linux側の設定
pciの[VendorID:DeviceID]を確認する。
$ lspci -nn | grep -i "serial controller"
00:16.3 Serial controller [0700]: Intel Corporation 7 Series/C210 Series Chipset Family KT Controller [8086:1e3d] (rev 04)
/etc/udev/rules.d/z25_sol.rules に上で確認したIDでttySOLへのシンボリックリンクを作成するように設定する。
KERNEL!="ttyS[0-9]", GOTO="no_serial"
ATTRS{vendor}!="0x8086", GOTO="vendor_not_intel"
ATTRS{device}=="0x1e3d", SYMLINK+="ttySOL", ENV{COMMENT}="Serial-Over-Lan $attr{vendor}:$attr{device}"
GOTO="vendor_not_intel"
LABEL="no_serial"
再起動すると以下のようにシンボリックリンクが作成されることが確認できる。
この状態でgettyを起動することによって、ttySOLが使えるようになる。
ブート時にgettyが立ち上がるように設定するために、 /etc/default/grubでカーネルの起動パラメータを以下のように変更しupdate-grubする。
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS4,115200n8"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --port=0xf0e0 --word=8 --parity=no --stop=1"
確認
192.168.xx.xx/255.255.255.0 と同じセグメントから http://192.168.xx.xx:16992/ にアクセスするとIntel AMTの画面が見れる。
また、以下でIntel AMTの情報を確認することも可能。
$ sudo apt install amtterm
$ export AMT_PASSWORD=P@assw0rd
$ amttool -h 192.168.xx.xx info
### AMT info on machine '192.168.xx.xx' ###
AMT version: 8.1.71
Hostname: your-hostname
Powerstate: S0
Remote Control Capabilities:
IanaOemNumber 0
OemDefinedCapabilities IDER SOL BiosSetup BiosPause
SpecialCommandsSupported PXE-boot HD-boot cd-boot
SystemCapabilitiesSupported powercycle powerdown powerup reset
SystemFirmwareCapabilities f800
Serial over LAN
別ホストからIntel AMTのIPアドレスを指定することによってSerial Over LANができた。
$ export AMT_PASSWORD=P@assw0rd
$ amtterm 192.168.xx.xx
amtterm: NONE -> CONNECT (connection to host)
ipv4 192.168.xx.xx [192.168.xx.xx] 16994 open
amtterm: CONNECT -> INIT (redirection initialization)
amtterm: INIT -> AUTH (session authentication)
amtterm: AUTH -> INIT_SOL (serial-over-lan initialization)
amtterm: INIT_SOL -> RUN_SOL (serial-over-lan active)
serial-over-lan redirection ok
connected now, use ^] to escape
Ubuntu 17.04 your-hostname ttyS4
your-hostname login:
BIOSの設定
Intel AMT経由でBIOSの設定をリモートでするには、 予めBIOSで下記のようにConsole TypeをVT100にしておかなければならない。
上記のように設定した状態で下記のように再起動するとBIOSの設定画面を操作することができる。
参考
- https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm?turl=WordDocuments%2Fconfiguringtheintelamtipaddress.htm
- https://www.intel.co.jp/content/www/jp/ja/architecture-and-technology/intel-amt-vulnerability-announcement.html
- https://software.intel.com/en-us/articles/using-intel-amt-serial-over-lan-to-the-fullest
- https://wiki.debian.org/AMT
- https://wiki.debian.org/AMT/SerialOverLan