You are not logged in.

#1 2021-05-16 15:49:21

Beli3ver
Member
Registered: 2013-08-25
Posts: 19

Problem with Time and OTP

Hello,

I have a Lenovo Thinkpad X1 Extreme Gen3. Before I installed arch, there was a Windows installed.
My Problem is, that the time was wrong.

So what did I do:

sudo ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
sudo timedatectl set-local-rtc 1 --adjust-system-clock
sudo hwclock --systohc
sudo ntpd -q

So nothing worked, so I changed manually the time yesterday:

timedatectl set-time "2021-05-17 05:39:30"

Now I have the correct time, but OTP not working anymore on my notebook. So there must still be an issue with the time.

Last edited by Beli3ver (2021-05-16 15:49:49)

Offline

#2 2021-05-16 16:26:49

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: Problem with Time and OTP

OTP = One time password? How does it relate to your description? What do you expect and what happens?

Offline

#3 2021-05-16 16:27:41

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,694

Re: Problem with Time and OTP

What is the output of timedatectl

??


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2021-05-16 16:48:26

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Problem with Time and OTP

tucuxi wrote:

OTP = One time password? How does it relate to your description?

OTP's use the system time for one of the hashing algorithm inputs. If the system clock is incorrect then it won't work.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2021-05-16 17:34:02

Beli3ver
Member
Registered: 2013-08-25
Posts: 19

Re: Problem with Time and OTP

This is the output from timedatectl

❯ timedatectl
               Local time: Mo 2021-05-17 19:33:23 CEST
           Universal time: Mo 2021-05-17 17:33:23 UTC
                 RTC time: Mo 2021-05-17 19:33:23
                Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode cannot be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.

Offline

#6 2021-05-16 17:51:10

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: Problem with Time and OTP

You need to enable the ntpd.service.

Offline

#7 2021-05-16 18:21:46

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: Problem with Time and OTP

Here is a quick script to detect if you local clock is widely off from official time without using ntp. You should get less than 2 seconds difference with this crude method when your clock is set properly.

echo $(( $(curl http://icanhazepoch.com/)/1000 - $(date +%s) ))

https://major.io/icanhazip-com-faq/

Before I installed arch, there was a Windows installed.

If windows is not installed anymore I urge you to convert back to keeping the hardware clock in UTC as described in the warning.
If you still dualboot windows, I still suggest you consider using the UTC hardware clock and configure windows to use that.
https://wiki.archlinux.org/title/System … ft_Windows

Last edited by progandy (2021-05-16 18:27:28)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#8 2021-05-16 18:30:06

Beli3ver
Member
Registered: 2013-08-25
Posts: 19

Re: Problem with Time and OTP

Ok, I do both, timedatectl looks like this now:

❯ timedatectl
               Local time: Mo 2021-05-17 20:28:52 CEST
           Universal time: Mo 2021-05-17 18:28:52 UTC
                 RTC time: Mo 2021-05-17 18:28:52
                Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

And your test script says this:

[malte@NB-RC-LOH-2 ~]$ echo $(( $(curl http://icanhazepoch.com/)/1000 - $(date +%s) ))
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    14  100    14    0     0    121      0 --:--:-- --:--:-- --:--:--   121
-86399

Offline

#9 2021-05-16 18:54:16

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: Problem with Time and OTP

Ah right. the date is wrong. Today is the 16th, not 17th.

For NTP the wiki has documentation for setting it up if you haven't found it yet.
https://wiki.archlinux.org/title/System … ronization
https://wiki.archlinux.org/title/Networ … col_daemon

Last edited by progandy (2021-05-16 19:02:21)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

Board footer

Powered by FluxBB