2

In /etc/dhcp/dhcpd.conf have added

omapi-port 7911;
omapi-key testkey;

key testkey {
  algorithm hmac-sha256;
  secret QUt1z1O3fxqgSDKILAMXFA==;
}

but it won't let me connect when I do

# systemctl restart dhcpd
# omshell 
> server localhost
> key testkey QUt1z1O3fxqgSDKILAMXFA==
> connect
dhcpctl_connect: not found

The key were generated by

# dnssec-keygen -a hmac-sha256 -b 128 -n USER dhcpupdate
# cat Kdhcpupdate.+163+41847.*
dhcpupdate. IN KEY 0 3 163 QUt1z1O3fxqgSDKILAMXFA==
Private-key-format: v1.3
Algorithm: 163 (HMAC_SHA256)
Key: QUt1z1O3fxqgSDKILAMXFA==
Bits: AAA=
Created: 20181123141544
Publish: 20181123141544
Activate: 20181123141544

Question

Can anyone see what I am doing wrong?

Sandra
  • 10,303
  • 38
  • 112
  • 165

2 Answers2

0

I was looking for some other omshell info today and landed on your question. Try quotes around your secret and a semi-colon after your last bracket:

key testkey {
  algorithm hmac-sha256;
  secret "QUt1z1O3fxqgSDKILAMXFA==";
};

I hope that helps.

  • hmac-sha256 doesn't seem to work (at least not on Solaris 11.3). I had to use hmac-md5 (the default algorithm) to be able to connect to the omshell service. – jelmd Mar 23 '23 at 18:26
-1

hmac-sha256 changed to HMAC-SHA256 or use HMAC-MD5

Example:

omapi-port 7911;
key omapi_key {
     algorithm HMAC-MD5;
     secret WRcLh5+g2U7kBL6u7+9kh6jv2OwHAQFlLOYUnBfYvmVFutggwGdzIeJL7dnbc5ROdmhl6Eg28wQ61Q==;
}
omapi-key omapi_key;
Zeitounator
  • 1,199
  • 5
  • 12