在/var/lib/bluetooth中就有蓝牙设备地址名字的文件夹

我这里是eaf22ab46bab
可以下载pstool,用管理员运行
./PsExec.exe -s -i regedit
直接在注册表中查看计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\
bashsudo apt install chntpw
chntpw -e SYSTEM #在C盘/Windows/System32/config下执行
#通过cd进入到\ControlSet001\Services\BTHPORT\Parameters\Keys
hex xxxxxxxxxx
进入到对应蓝牙设备的字段
bash(...)\BTHPORT\Parameters\Keys\4c796ee798ba> ls
Node has 2 subkeys and 1 values
  key name
  <eaf22ab46bab>
  <f3dae3f62545>
  size     type              value name             [value if type DWORD]
    16  3 REG_BINARY         <CentralIRK>
(...)\BTHPORT\Parameters\Keys\4c796ee798ba> cd eaf22ab46bab
(...)\Parameters\Keys\4c796ee798ba\eaf22ab46bab> ls
Node has 0 subkeys and 13 values
  size     type              value name             [value if type DWORD]
    16  3 REG_BINARY         <LTK>
     4  4 REG_DWORD          <KeyLength>               16 [0x10]
     8  b REG_QWORD          <ERand>
     4  4 REG_DWORD          <EDIV>                 24016 [0x5dd0]
    16  3 REG_BINARY         <IRK>
     8  b REG_QWORD          <Address>
     4  4 REG_DWORD          <AddressType>              1 [0x1]
    16  3 REG_BINARY         <CSRKInbound>
     8  b REG_QWORD          <InboundSignCounter>
    16  3 REG_BINARY         <CSRK>
     4  4 REG_DWORD          <OutboundSignCounter>      0 [0x0]
     4  4 REG_DWORD          <CEntralIRKStatus>         1 [0x1]
     4  4 REG_DWORD          <AuthReq>                 45 [0x2d]
(...)\Parameters\Keys\4c796ee798ba\eaf22ab46bab> 
输入hex + value_name 查询link key的值,然后在ubuntu对应文件中修改即可。
经过测试,其他的删掉也不影响。只要确保Longtermkey的内容即可
bashsudo systemctl restart bluetooth