Bluetooth bağlantı anahtarları Ubuntu 14.10'da nerede saklanır?


10

Ubuntu 14.10'da bir cihaz için belirli bluetooth bağlantı anahtarları ayarlamaya çalışıyorum, ancak nerede depolandıklarını bulamıyorum.
Amaç, işletim sistemlerini değiştirdikten sonra yeniden eşleştirmek zorunda kalmadan hem Ubuntu hem de Windows'da çalışan bir bluetooth fareye sahip olmaktır.
AskUbuntu'da bulduğum tüm cevaplar, anahtarların saklandığını /var/lib/bluetooth/<mac_address>/linkkeysve bunun en azından 13.10'a kadar olduğu gibi olduğunu belirtti, ancak 14.10'da bu dosya temiz bir masaüstü kurulumunda eksik ve manuel olarak oluşturmanın hiçbir etkisi yok, bluetoothd.

EDIT: Görünüşe göre fare bir eşleştirme isteği vermiyor ve bağlantı anahtarları bu durumda saklanmaz. Bununla birlikte, fareyi Windows'a bağlamak ve daha sonra Ubuntu'da yeniden başlatmak bluetooth bağlantısının başarısız olmasına neden olur (ve farenin kaldırılması ve bluetooth cihaz listesine yeniden eklenmesi gerekir), bu yüzden kesinlikle bazı anahtar değişimi / kimlik doğrulaması devam eder. fare her iki işletim sisteminde paylaşılmasını. Soru hala, bu fareyi bağlarken kaydedilmiş bağlantı anahtarlarını kaydetmek ve kullanmak için bluetoothd'yi nasıl zorlayabilirim?

Donanım detayları:

  • Microsoft Bluetooth Dizüstü Bilgisayar Faresi 5000
  • 413c: 8161 Dell Computer Corp. Kablosuz 365 Bluetooth (Broadcom BCM2046B1)

Aşağıdaki iki günlük, eşleştirilebilir bir cihaz (cep telefonu) için anahtarların linkkeys dosyasında saklandığını gösterir; fare için durum böyle değil. Eski bluetoothd sürümlerinin fareler için bağlantı anahtarlarını kaydetmek için kullanıldığını biliyorum, çünkü askubuntu ve ubuntuforums'da linkkey'leri Windows'dan Ubuntu'ya kopyalamak için iki işletim sistemi arasında özel bir amaç için birçok cevap / öğretici var.

Fare keşfi ve bağlantı kurulumu için bluetoothd günlüğü:

    bluetoothd[15615]: plugins/mgmtops.c:mgmt_start_discovery() index 0
    bluetoothd[15615]: Discovery session 0x7feb52b14130 with :1.137 activated
    bluetoothd[15615]: src/adapter.c:session_ref() 0x7feb52b14130: ref=1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 10 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_cmd_complete() 
    bluetoothd[15615]: plugins/mgmtops.c:start_discovery_complete() hci0 type 1 status 0
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 8 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_discovering() Controller 0 type 1 discovering 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 25 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_device_found() hci0 addr DE:AD:BE:EF:00:00, rssi -43 flags 0x0003 eir_len 5
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_confirm_name() hci0 bdaddr DE:AD:BE:EF:00:00 name_known 0
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 16 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_cmd_complete() 
    bluetoothd[15615]: Unknown command complete for opcode 37
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 61 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_device_found() hci0 addr DE:AD:BE:EF:00:00, rssi -43 flags 0x0000 eir_len 41
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 8 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_discovering() Controller 0 type 1 discovering 0
    bluetoothd[15615]: src/adapter.c:adapter_set_discovering() hci0 restarting discovery, disc_sessions 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_start_discovery() index 0
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 10 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_cmd_complete() 
    bluetoothd[15615]: plugins/mgmtops.c:start_discovery_complete() hci0 type 1 status 0
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 8 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_discovering() Controller 0 type 1 discovering 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 25 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_device_found() hci0 addr DE:AD:BE:EF:00:00, rssi -43 flags 0x0003 eir_len 5
    bluetoothd[15615]: src/adapter.c:session_unref() 0x7feb52b14130: ref=0
    bluetoothd[15615]: src/adapter.c:session_remove() Discovery session 0x7feb52b14130 with :1.137 deactivated
    bluetoothd[15615]: src/adapter.c:session_remove() Stopping discovery
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_stop_discovery() index 0
    bluetoothd[15615]: Stopping discovery
    bluetoothd[15615]: src/adapter.c:create_device() DE:AD:BE:EF:00:00
    bluetoothd[15615]: src/adapter.c:adapter_create_device() DE:AD:BE:EF:00:00
    bluetoothd[15615]: src/device.c:device_create() Creating device /org/bluez/15615/hci0/dev_DE:AD:BE:EF:00:00
    bluetoothd[15615]: src/device.c:btd_device_ref() 0x7feb52b15680: ref=1
    bluetoothd[15615]: src/device.c:device_set_temporary() temporary 1
    bluetoothd[15615]: src/device.c:btd_device_ref() 0x7feb52b15680: ref=2
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 10 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_cmd_complete() 
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_cmd_complete() stop_discovery complete
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 8 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_discovering() Controller 0 type 1 discovering 0
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 65 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_device_connected() hci0 device DE:AD:BE:EF:00:00 connected eir_len 46
    bluetoothd[15615]: src/adapter.c:adapter_get_device() DE:AD:BE:EF:00:00
    bluetoothd[15615]: src/device.c:device_probe_drivers() Probing drivers for DE:AD:BE:EF:00:00
    bluetoothd[15615]: input/manager.c:hid_device_probe() path /org/bluez/15615/hci0/dev_DE:AD:BE:EF:00:00
    bluetoothd[15615]: src/device.c:btd_device_ref() 0x7feb52b15680: ref=3
    bluetoothd[15615]: input/device.c:input_device_new() Registered interface org.bluez.Input on path /org/bluez/15615/hci0/dev_DE:AD:BE:EF:00:00
    bluetoothd[15615]: src/device.c:device_set_temporary() temporary 0
    bluetoothd[15615]: src/device.c:btd_device_unref() 0x7feb52b15680: ref=2

Bir cep telefonunun eşleştirilmesi için bluetoothd günlüğü (kullanıcıdan her iki cihazda gösterilen bir kodu doğrulaması istenir):

    bluetoothd[15615]: plugins/mgmtops.c:mgmt_start_discovery() index 0
    bluetoothd[15615]: Discovery session 0x7feb52b14ca0 with :1.138 activated
    bluetoothd[15615]: src/adapter.c:session_ref() 0x7feb52b14ca0: ref=1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 10 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_cmd_complete() 
    bluetoothd[15615]: plugins/mgmtops.c:start_discovery_complete() hci0 type 1 status 0
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 8 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_discovering() Controller 0 type 1 discovering 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 64 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_device_found() hci0 addr DE:AD:BE:EF:01:01, rssi -52 flags 0x0000 eir_len 44
    bluetoothd[15615]: src/adapter.c:session_unref() 0x7feb52b14ca0: ref=0
    bluetoothd[15615]: src/adapter.c:session_remove() Discovery session 0x7feb52b14ca0 with :1.138 deactivated
    bluetoothd[15615]: src/adapter.c:session_remove() Stopping discovery
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_stop_discovery() index 0
    bluetoothd[15615]: Stopping discovery
    bluetoothd[15615]: src/adapter.c:adapter_create_device() DE:AD:BE:EF:01:01
    bluetoothd[15615]: src/device.c:device_create() Creating device /org/bluez/15615/hci0/dev_DE:AD:BE:EF:01:01
    bluetoothd[15615]: src/device.c:btd_device_ref() 0x7feb52b17cd0: ref=1
    bluetoothd[15615]: src/device.c:device_set_temporary() temporary 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_create_bonding() hci0 bdaddr DE:AD:BE:EF:01:01 io_cap 0x01
    bluetoothd[15615]: src/device.c:bonding_request_new() Requesting bonding for DE:AD:BE:EF:01:01
    bluetoothd[15615]: src/device.c:bonding_request_new() Temporary agent registered for DE:AD:BE:EF:01:01 at :1.138:/org/bluez/agent/wizard
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 10 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_cmd_complete() 
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_cmd_complete() stop_discovery complete
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 8 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_discovering() Controller 0 type 1 discovering 0
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 37 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_device_connected() hci0 device DE:AD:BE:EF:01:01 connected eir_len 18
    bluetoothd[15615]: src/adapter.c:adapter_get_device() DE:AD:BE:EF:01:01
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 18 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_user_confirm_request() hci0 DE:AD:BE:EF:01:01 confirm_hint 0
    bluetoothd[15615]: src/adapter.c:adapter_get_device() DE:AD:BE:EF:01:01
    bluetoothd[15615]: src/device.c:new_auth() Requesting agent authentication for DE:AD:BE:EF:01:01
    bluetoothd[15615]: src/agent.c:agent_request_confirmation() Calling Agent.RequestConfirmation: name=:1.138, path=/org/bluez/agent/wizard, passkey=436733
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_confirm_reply() index 0 addr DE:AD:BE:EF:01:01 success 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 16 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_cmd_complete() 
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_cmd_complete() user_confirm_reply complete
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 32 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_new_link_key() Controller 0 new key of type 5 pin_len 0
    bluetoothd[15615]: src/adapter.c:adapter_get_device() DE:AD:BE:EF:01:01
    bluetoothd[15615]: src/event.c:btd_event_link_key_notify() storing link key of type 0x05
    bluetoothd[15615]: src/device.c:device_set_bonded() bonded 1
    bluetoothd[15615]: src/device.c:device_set_temporary() temporary 0
    bluetoothd[15615]: src/adapter.c:adapter_get_device() DE:AD:BE:EF:01:01
    bluetoothd[15615]: src/device.c:device_bonding_complete() bonding 0x7feb52b2d270 status 0x00
    bluetoothd[15615]: src/device.c:device_bonding_complete() Proceeding with service discovery
    bluetoothd[15615]: src/device.c:btd_device_ref() 0x7feb52b17cd0: ref=2
    bluetoothd[15615]: src/agent.c:agent_release() Releasing agent :1.138, /org/bluez/agent/wizard
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() cond 1
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_event() Received 16 bytes from management socket
    bluetoothd[15615]: plugins/mgmtops.c:mgmt_cmd_complete() 
    bluetoothd[15615]: plugins/mgmtops.c:pair_device_complete() hci0 DE:AD:BE:EF:01:01 pairing complete status 0
    bluetoothd[15615]: src/adapter.c:adapter_get_device() DE:AD:BE:EF:01:01
    bluetoothd[15615]: src/device.c:device_bonding_complete() bonding (nil) status 0x00

Ben 14.04 var ve dizin benim için var, ama mac adresi benim iç bluetooth ve linkkeys için boş ...
Fabby

14.04 vardı ve 14.10 yükseltti, şimdi dizini bulamıyorum. BT faresi için bağlantı anahtarını ayarlamak isteyen sizinle aynı sorunu yaşıyorum.
Alasjo

Yanıtlar:


3

Bir süre sonra nihayet karşılaştığım sorunu çözdüm. Hala ilk soruya bir cevap bulamadım (bağlantı anahtarlarının bu belirli bluez / adaptör / çevresel kombinasyon için nerede depolandığını belirleyemedim) ama bluez varsa linkkeys dosyasını okuyacağını öğrendim, ve dosyadaki anahtarları kullanır.

Bu nedenle, bağlantı anahtarları eşleştirmeden sonra dosyaya yazılmasa bile, bu anahtarları linkkeys dosyasına manuel olarak ekleyerek geçersiz kılmak mümkündür.

Anahtar türünün doğru ayarlanması önemlidir, aksi takdirde anahtar yok sayılır.

Referans olarak, benim durumumda çalışan anahtar türü burada gösterilmektedir: https://askubuntu.com/a/246791/352576


1

Ubuntu 13.10 bluez 4.98, 14.04 ve 14.10 kullanır 4.101

Her iki sürüm de aynı seçenekle derlendi (--localstatedir = / var)

14.04 kullanıyorum ve dosyalar var ve bir cihaz kaldırmak veya eklemek / var / lib / bluetooth / (myadapteraddress) / linkkeys dosya buna göre güncellenir.

14.10 sisteminde bir test yaptım, bir BT cihazı ekledim ve / var / lib / bluetooth / (adapteraddress) / linkkeys dosyası oluşturuldu

Belki de daha yeni bir bluez sürümü kullanıyorsunuz.

Bluez'in yeni sürümleri için şema (5'ten sonra sanırım):

/var/lib/bluetooth/<adapter address>/<remote device address>/info

Yeni bluez sürümü için ayar depolama dokümantasyonunda şunu buldum:

http://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/settings-storage.txt

...

Storage directory structure

There is one directory per adapter, named by its Bluetooth address, which
contains:
 - a settings file for the local adapter
 - an attributes file containing attributes of supported LE services
 - a cache directory containing:
    - one file per device, named by remote device address, which contains device name
 - one directory per remote device, named by remote device address, which contains:
    - an info file
- an attributes file containing attributes of remote LE services
- a ccc file containing persistent Client Characteristic Configuration
  (CCC) descriptor information for GATT characteristics

So the directory structure is:

/var/lib/bluetooth/<adapter address>/

    ./settings
    ./attributes
    ./cache/
        ./<remote device address>
        ./<remote device address>
        ...
    ./<remote device address>/
        ./info
        ./attributes
        ./ccc
    ./<remote device address>/
        ./info
        ./attributes
    ...

...

Info file format

...

[LinkKey] group contains:

  Key           String      Key in hexadecimal format

  Type          Integer     Type of link key

  PINLength     Integer     Length of PIN

...

Her durumda bluez, / var / lib / bluetooth içindeki dosyaları depolamalı

Bu komutu kullanırsanız

bluetoothd --version

4.101 aldın mı?


1
Evet, bluetoothd sürümü 4.101'dir. var/lib/bluetoooth/<adapter address>Klasörün var ama hiçbir linkkeys dosya, ne de herhangi bir alt dizin var. Bluetooth cihazı eşleştirilmiş ve çalışıyor, bu yüzden anahtarlar bir yerde saklanıyor ama kesinlikle orada değil. Belki Ubuntu sürümü anahtarları başka bir yerde saklar ve nerede olduğunu bulmaya çalışıyorum. Bluetooth göstergesi ile yapılan standart bir 14.10 masaüstü kurulumu kullanıyorum, fantezi bir şey yok.
ATAKAMA

1
Bazı bluetooth adaptörlerinde donanım anahtarı depolama alanı vardı. Ubuntu bluetoothd'un bağlantı anahtarlarını dosya sisteminde değil, yalnızca adaptör belleğinde saklaması mümkün müdür? Adaptör: 413c: 8160 Dell Computer Corp. Broadcom BCM2046 tabanlı Kablosuz 365 Bluetooth
ATAKAMA

Başka bir cihazı, bir cep telefonunu
ayrıştırmayı denediniz

Bu adaptörle hiç eşleştirilmemiş bir cep telefonunu eşleştirdim (ne Ubuntu'da ne de Windows'ta). Linkkeys dosyası oluşturuldu. Sonra fareyi tekrar eşleştirmeye çalıştım, eşleştirildi, ancak bağlantı anahtarı dosyaya eklenmedi. Bluetoothd'un dosyadaki bağlantı anahtarını okumasını ve bağdaştırıcıdaki kod anahtarını kullanmamasını nasıl sağlarım (muhtemelen yaptığı gibi)?
ATAKAMA

Bu çok meraklı ... Belki cihazı pencerelerde kaldırırsanız ubuntu dosyayı oluşturur.
J.Serra

0

/ var / lib / bluetooth / {bluetoothaddr} / linkkeys

Nerede {bluetoothaddr} bluetooth arayüzü (sadece birini olmalıdır, bir mac adresi gibi görünüyor)

Dosya biçimi {remoteaddr} {128 bit bağlantı anahtarı} {type} şeklindedir.

20:12:03:22:EE:0E C21D3A69DEA0A8C629F1BB5D12AEEA79 4 0
00:18:94:68:3E:90 EC02519ED656DB87B7F152E899F8A810 0 4
00:21:3F:3E:2E:6C 948A0EF91FA8E9EB9032CE775BF8E0B0 0 4

Lütfen soru metnini dikkatlice okuyunuz. Bu dosya artık 14.10 kurulumunda mevcut değil. Dosya sisteminin hiçbir yerinde linkkeys dosyası yok. Anahtarlar başka bir yerde saklanır. Soru nerede.
ATAKAMA

Yüklediğim yeni dizüstü bilgisayarımda (güncelleme yok) 14.10, hala açıkladığım gibi dosya var. bluetoothd 4.101. Yeni bir cihazı eşleştirmeye çalıştığınızda syslog'daki mesajlar nedir?
Xavier

Soruyu düzenledim ve bu farenin keşif ve bağlantı kurulumuyla bağlantı anahtarları kaydedilen bir cep telefonunun bağlantı kurulumunu karşılaştırmak için bazı günlükler ekledim.
ATAKAMA

0

Debian Jessie & Ubuntu'da da PIN'i kullanmak için manuel olarak ayarlayabilirsiniz.

  1. Bu yazının https://askubuntu.com/a/246791/352576 Windows anahtarınızı almak için açıkladığını yapın.
  2. senin /var/lib/bluetooth/XX:XX:XX:XX:XX:AA(burada XX: ... :AABT fare / klavye mac ile bir dir içermelidir PC'nizin BT adaptörünün mac olan) (ı olarak temsil edeceğiz XX: ... :BF&, ayarlar ve dosyalar yapılandırma.
  3. içinde root için rw izinlerine sahip XX: ... BFbir dosya var info. Başka izin yok. - içerik:

    [LinkKey] 
    Key=A7XXXXXXXXXXXXXXXXXXXXXXXXXXXX89 
    Type=4
    PINLength=0
    
    [General]
    Name=yourMouseName
    Class=0x002580
    SupportedTechnologies=BR/EDR;
    Trusted=true
    Blocked=false
    Services=00001000-0000-1000-8000-00805f9b34fb;00001124-0000-1000-8000-00805f9b34fb;00001200-0000-1000-8000-00805f9b34fb;
    
    [DeviceID]
    Source=2
    Vendor=1133
    Product=45069
    Version=1792
    

    Anahtar uzunluğunun 16 bayt uzunluğunda olduğunu unutmayın.

linkkeys dosyalarını bu dizinlere yapıştırmak bana yardımcı olmadı - ancak onları iyi bir şekilde bıraktım.

Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.