Results 1 to 3 of 3

Thread: Kali time synchronization: ntpsec, "Time and Date" settings, and general sync approach

  1. #1
    Join Date
    2017-Apr
    Posts
    5

    Kali time synchronization: ntpsec, "Time and Date" settings, and general sync approach

    The TLDR-Q: What is the proper / intended approach in Kali for configuring date / time synchronization?

    I am not clear on the intended approach to time / date synchronization in kali given several factors, on a vanilla 2023.1 rolling kali install:

    1. Time and Date settings

      Going into the settings in the UI, I tried to turn on date synchronization ("Keep synchronized with Internet servers"), but immediately receive the error dialog:

      Screenshot 2023-03-21 at 11.54.40 AM.jpg

      That didn't seem right -- I made sure ntpsec was enabled and running, ntp.conf settings and logging were configured, and then tried it again. Same problem....seems settings doesn't detect NTP.

      Code:
      systemctl list-unit-files | grep ntp
      ntpsec-systemd-netif.path                  enabled         enabled
      ntp.service                                alias           -
      ntpd.service                               alias           -
      ntpsec-rotate-stats.service                static          -
      ntpsec-systemd-netif.service               static          -
      ntpsec-wait.service                        disabled        disabled
      ntpsec.service                             enabled         disabled
      ntpsec-rotate-stats.timer                  enabled         enabled
      ntpsec.timer                               masked          enabled
      This shows both ntp and ntpd are aliased to ntpsec, which appears to be running fine per an NTP query:

      Code:
      $ ntpq -c sysinfo
      associd=0 status=0018 leap_none, sync_unspec, 1 event, no_sys_peer,
      system peer:       65-100-46-164.dia.static.qwest.net:123
      system peer mode:   client
      leap indicator:               00
      stratum:                       2
      log2 precision:              -24
      root delay:               45.379
      root dispersion:          45.446
      root distance              28.26
      reference ID:      65.100.46.164
      reference time:    e7c483ab.80c7d744 2023-03-21T19:27:39.503Z
      system jitter:          4.480355
      clock jitter:           17.00058
      clock wander:                0.0
      symm. auth. delay:           0.0
      Note that I also started the ntpsec-wait service and retested Time and Date settings, and received the same error.

    2. timedatectl output

      I ran a simple test to see the state of system clock synchronization.

      Code:
      timedatectl
                     Local time: Tue 2023-03-21 12:34:04 MST
                 Universal time: Tue 2023-03-21 19:34:04 UTC
                       RTC time: Tue 2023-03-21 19:34:04
                      Time zone: America/Phoenix (MST, -0700)
      System clock synchronized: yes
                    NTP service: n/a
                RTC in local TZ: no
      I noticed that while the clock shows as synchronized, the NTP service shows as "n/a". So I tried to start NTP and received this:

      Code:
      timedatectl set-ntp true                 
      Failed to set ntp: NTP not supported


    I asked really the overarching question about how to get this working at the very top of this post, but not knowing a number of things about the design intent here (and checking the kali release doc to see if there was anything mentioned there about this, and found nothing), I had a number of questions:

    1. Why would time synchronization not be directly configurable from the UI right out of the box -- is there some reason this is undesirable?
    2. What is the intended approach to getting time synchronization working in a matter consistent with the UI (or at least all parts of the system working in tandem)?
    3. Most of the online resources I've come across do not use ntpsec, but other packages (ntp or ntpd directly / differently). I'm assuming the intent was to leverage the existing ntpsec installation -- can someone help out how to do this?


    I really appreciate any help given. While I have this question in general for any kali installation, I'm trying to define a base VM image which will be leveraged for many other cloned VMs, so it is important I get this right, or else my future redo may be multiplied. Thx again for your help!

  2. #2
    Join Date
    2021-May
    Location
    UK
    Posts
    782
    Kali is designed to be 'quiet' on a network, so any 'chatty' network services are not enabled by default, and in this case, ntp isn't even installed!

    sudo apt install ntp

    and then you can set it up. Be aware of course that an ntp server will cause network traffic that can be seen.

  3. #3
    Join Date
    2017-Apr
    Posts
    5
    Fred,

    Thanks for the reply! I think you've answered the question as to why ntpsec isn't enabled by default with this quote:

    Quote Originally Posted by Fred Sheehan View Post
    Kali is designed to be 'quiet' on a network, so any 'chatty' network services are not enabled by default.
    But ntp is installed in the form of ntpsec by default -- the ntp service is aliased to ntpsec, and if ntpsec is enabled, syncs time as expected. In fact, if you try to install the ntp stand-alone package, it will uninstall ntpsec. So the question isn't whether ntp is running or not or whether it time syncs -- if ntpsec is enabled (manually) it will. The question is what is the intention / direction for time syncing in kali:

    - On one hand, the default ntpsec time sync service in kali isn't detected by the UI "Time and Date" settings or the timedatectl utility;
    - On the other hand, the UI "Time and Date settings and the timedatectl utility will properly detect ntp if you uninstall the default ntpsec and install the stand-alone ntp package instead.

    The point is what is the intended time syncing approach of the vanilla kali distro. "Time and Date" settings' Internet syncing should work out of the box if turned on, but it does not. Might be totally off, but an ntp detection bug seems possible....whatever criteria is being used by "Time and Date" settings and timedatectl doesn't work when ntpsec is governing ntp.

    If anyone has any insight, greatly appreciated!

    Thanks again for the response!

Similar Threads

  1. Time Synchronization Problems on MacBook Air
    By snapetom in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2021-04-04, 22:09
  2. Network Time Synchronization fails
    By alacos in forum TroubleShooting Archive
    Replies: 13
    Last Post: 2019-05-28, 10:43
  3. Replies: 1
    Last Post: 2018-08-26, 01:56
  4. Automatic HID attack - or "Right On Time" HID attacks
    By uzy in forum NetHunter Suggestions
    Replies: 1
    Last Post: 2014-10-29, 10:54

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •