Skip to main content
Hyper 8 Spacefun Videos

Datum und Uhrzeit einstellen unter Linux

720p 2.7 MB 720p 2.7 MB

Einsteiger - Preview

Distro WAS? Was ist eine Linux Distribution 24 Oct 2024, 52 sec
Linux herunterladen und Brennen 24 Oct 2024, 52 sec
Meine Lieblings Firefox AddOns 24 Oct 2024, 52 sec
Linux Installieren für Anfänger: In nur 15 Minuten ist Linux drauf 24 Oct 2024, 52 sec
pimp My IceWM - Linux Desktop Design mit Themes und Icons anpassen 24 Oct 2024, 52 sec
Programme installieren unter Linux auf der CLI und mit der Paketverwaltung 24 Oct 2024, 52 sec
Linux Terminal für Einsteiger 24 Oct 2024, 52 sec
Linux updaten - So aktualisierst du sicher deine Linux Distribution 24 Oct 2024, 52 sec
Benutzer und Gruppen verwalten unter Linux 24 Oct 2024, 52 sec
LibreOffice über die Kommandozeile installieren 24 Oct 2024, 52 sec
Linux Password einfach ändern auf der CLI 24 Oct 2024, 52 sec
Logdateien unter Linux anzeigen und Fehler analysieren 24 Oct 2024, 52 sec
Linux Bootsplash anpassen mit Plymouth 24 Oct 2024, 52 sec
Festplattenauslastung unter Linux ermitteln 24 Oct 2024, 52 sec
Desktop Icons mit iDesk für deinen Linux Windowmanager 24 Oct 2024, 52 sec
Linux Firewall einrichten – Schritt für Schritt zum sicheren System 24 Oct 2024, 52 sec
Alle Programme sofort griffbereit: Application Finder einrichten (oder "Wie komme ich aus vi raus?") 24 Oct 2024, 52 sec
Gefahr gebannt! ClamAV Virenabwehr für dein Linux System 24 Oct 2024, 52 sec
Wie man den Memtest86+ RAM-Test unter Linux erfolgreich nutzt 24 Oct 2024, 52 sec
Unterschiedliche Desktop Umgebungen testen 24 Oct 2024, 52 sec
Linux Backup Tutorial - Laufwerk vorbereiten 24 Oct 2024, 52 sec
Linux Backup Tutorial: Back In Time 24 Oct 2024, 52 sec
Dynablaster Revenge - Bomberman Spiel selbst compilieren 24 Oct 2024, 52 sec
Linux Desktopumgebung LXQt vs. LXDE 24 Oct 2024, 52 sec
Desktop Effekte unter LXQt aktivieren 24 Oct 2024, 52 sec
Die besten Podcast-Clients für Linux 24 Oct 2024, 52 sec
Sicherer SSH-Zugriff unter Linux 24 Oct 2024, 52 sec
Firefox direkt von Mozilla.org installieren 24 Oct 2024, 52 sec
Software sauber entfernen unter Linux mit Apt Rollback 24 Oct 2024, 52 sec
Linux Remote Desktop mit X2Go 24 Oct 2024, 52 sec
Ubuntu LTS installieren oder aktualisieren 24 Oct 2024, 52 sec
Windows in Docker 24 Oct 2024, 52 sec
Portmaster - die perfekte Desktop-Firewall 24 Oct 2024, 52 sec
Linux Multiboot – USB-Stick & Netzwerk mit Ventoy und iVentoy 24 Oct 2024, 52 sec
Thunderbird - das sichere E-Mail Programm 24 Oct 2024, 52 sec
Replay
Current video (36 of 38) in Einsteiger - Preview Datum und Uhrzeit einstellen unter Linux 24 Oct 2024, 52 sec
Schnellsten Linux Mirror ermitteln 24 Oct 2024, 52 sec
Festplatte partitionieren unter Linux 24 Oct 2024, 52 sec
00:00 / 00:52
Distro WAS? Was ist eine Linux Distribution 24 Oct 2024, 52 sec
Linux herunterladen und Brennen 24 Oct 2024, 52 sec
Meine Lieblings Firefox AddOns 24 Oct 2024, 52 sec
Linux Installieren für Anfänger: In nur 15 Minuten ist Linux drauf 24 Oct 2024, 52 sec
pimp My IceWM - Linux Desktop Design mit Themes und Icons anpassen 24 Oct 2024, 52 sec
Programme installieren unter Linux auf der CLI und mit der Paketverwaltung 24 Oct 2024, 52 sec
Linux Terminal für Einsteiger 24 Oct 2024, 52 sec
Linux updaten - So aktualisierst du sicher deine Linux Distribution 24 Oct 2024, 52 sec
Benutzer und Gruppen verwalten unter Linux 24 Oct 2024, 52 sec
LibreOffice über die Kommandozeile installieren 24 Oct 2024, 52 sec
Linux Password einfach ändern auf der CLI 24 Oct 2024, 52 sec
Logdateien unter Linux anzeigen und Fehler analysieren 24 Oct 2024, 52 sec
Linux Bootsplash anpassen mit Plymouth 24 Oct 2024, 52 sec
Festplattenauslastung unter Linux ermitteln 24 Oct 2024, 52 sec
Desktop Icons mit iDesk für deinen Linux Windowmanager 24 Oct 2024, 52 sec
Linux Firewall einrichten – Schritt für Schritt zum sicheren System 24 Oct 2024, 52 sec
Alle Programme sofort griffbereit: Application Finder einrichten (oder "Wie komme ich aus vi raus?") 24 Oct 2024, 52 sec
Gefahr gebannt! ClamAV Virenabwehr für dein Linux System 24 Oct 2024, 52 sec
Wie man den Memtest86+ RAM-Test unter Linux erfolgreich nutzt 24 Oct 2024, 52 sec
Unterschiedliche Desktop Umgebungen testen 24 Oct 2024, 52 sec
Linux Backup Tutorial - Laufwerk vorbereiten 24 Oct 2024, 52 sec
Linux Backup Tutorial: Back In Time 24 Oct 2024, 52 sec
Dynablaster Revenge - Bomberman Spiel selbst compilieren 24 Oct 2024, 52 sec
Linux Desktopumgebung LXQt vs. LXDE 24 Oct 2024, 52 sec
Desktop Effekte unter LXQt aktivieren 24 Oct 2024, 52 sec
Die besten Podcast-Clients für Linux 24 Oct 2024, 52 sec
Sicherer SSH-Zugriff unter Linux 24 Oct 2024, 52 sec
Firefox direkt von Mozilla.org installieren 24 Oct 2024, 52 sec
Software sauber entfernen unter Linux mit Apt Rollback 24 Oct 2024, 52 sec
Linux Remote Desktop mit X2Go 24 Oct 2024, 52 sec
Ubuntu LTS installieren oder aktualisieren 24 Oct 2024, 52 sec
Windows in Docker 24 Oct 2024, 52 sec
Portmaster - die perfekte Desktop-Firewall 24 Oct 2024, 52 sec
Linux Multiboot – USB-Stick & Netzwerk mit Ventoy und iVentoy 24 Oct 2024, 52 sec
Thunderbird - das sichere E-Mail Programm 24 Oct 2024, 52 sec
Current video (36 of 38) in Einsteiger - Preview Datum und Uhrzeit einstellen unter Linux 24 Oct 2024, 52 sec
Schnellsten Linux Mirror ermitteln 24 Oct 2024, 52 sec
Festplatte partitionieren unter Linux 24 Oct 2024, 52 sec
Hallo liebe Zeitspringer:innen. In diesem Video  möchte ich euch zeigen, wie ihr eure Uhrzeit 00:00
auf eurem Linux-System ganz einfach einstellen  könnt. Vielleicht habt ihr das schon mal erlebt, 00:07
wenn ihr euer System aktualisieren wollt, dann  geht irgendetwas schief. Ich probiere das hier 00:12
gerade mal mit 'sudo apt update' im Terminal. Er  startet jetzt hier, es sieht noch alles ganz gut 00:17
aus und hier kommt jetzt eine Fehlermeldung  'Release Datei ist noch nicht gültig, 00:24
ungültig für weitere 3 Tage'. Das heißt, da stimmt  irgendetwas mit der Uhrzeit auf unserem System 00:32
noch nicht. Das können wir ganz einfach prüfen,  indem wir den Befehl 'date' eingeben. Heute ist 00:39
der 24. Oktober 2024 und ich sehe hier, oh, er  hat hier den 20. Oktober eingestellt. Das ist 00:45
natürlich falsch. Das heißt diese Daten sind für  3 Tage und 17 Minuten noch nicht gültig. Ich muss 00:53
also sicherstellen, dass meine Uhrzeit wirklich  der tatsächlichen Uhrzeit entspricht. Und dazu 01:00
gibt es unter Linux verschiedene Möglichkeiten  und wie die aussehen, das zeige ich dir jetzt in 01:07
diesem Video. Ich werde jetzt die folgenden  Befehle alle mit Root-Rechten ausführen, da 01:12
Änderungen am System mit Root-Rechten ausgeführt  werden müssen. Deswegen starte ich mir hier eine 01:18
Root-Shell mit dem Befehl 'sudo bash'. Jetzt bin  ich in der Root-Shell, das sehe ich hier daran, 01:23
dass hier vorne 'root' vorne dran steht. Jetzt  kann ich als allererstes Mal auf einem modernen 01:28
Linux-System, welches systemd verwendet, den  Befehl 'timedatectl' eingeben. Der zeigt mir 01:34
nämlich hier jetzt auch noch mal genau an, wie  die Uhrzeit hier ist. 'Local time', das ist 01:42
meine lokale Time 'CEST', Central European Time,  Zeitzone stimmt in dem Fall also 'Europe/ Zurich'. 01:47
Die könnte man mit 'timedatectl' zur Not auch noch  ändern. 'System clock synchronized', da sagt er 01:54
hier nein. 'NTP Service' 'inactive' und da ist  schon genau das Problem. 'timedatectl' bringt 02:01
nämlich tatsächlich auch schon eigenen NTP-Service  mit und kann auch die Uhrzeit aus dem Internet 02:08
schon synchronisieren. Es gibt aber verschiedene  andere Wege, und ich möchte euch jetzt mal 02:13
ein paar davon vorab noch zeigen. Und zwar das  bekannteste wäre wahrscheinlich NTP oder 'ntpd'. 02:18
Wie der zu installieren geht, das zeige ich dir.  Das musst du jetzt als Root machen. Ich müsste 02:26
ich jetzt kein 'sudo' voran angeben. Ansonsten als  User 'sudo apt install ntp' und dann installiere 02:30
ich mir zusätzlich noch das Programm 'ntpdate'.  Denn damit kann ich die Zeit direkt einstellen. 02:37
Jetzt sehen wir aber hier, oh, das geht jetzt  noch nicht, weil die Uhrzeit ist natürlich falsch. 02:45
Deswegen kann ich im Moment keine Aktualisierungen  vornehmen. Ich muss jetzt also einmal manuell 02:51
die Uhrzeit erstmal richtig stellen. Und das  mache ich jetzt hier, indem ich jetzt mal hier 02:56
annähernd ungefähr die Uhrzeit einstelle, die wir  jetzt heute hier haben. Da sage ich jetzt mal 14 03:01
und probiere es jetzt noch mal. Ich sage noch mal  'sudo apt update', weil er die Paketquellen jetzt 03:10
noch installiert, noch nicht aktualisiert  hat und jetzt kann ich das tatsächlich 03:17
installieren. Hier sagt er jetzt ntp kollidiert  mit ntpsec, also ntp ist jetzt ersetzt worden 03:21
durch ntpsec. Also ich müsste jetzt das  Paket ntpsec installieren, das hat sich 03:32
geändert. ntp ist auf Debian-basierten-System  mittlerweile durch ntpsec ersetzt worden. Dann 03:38
seht ihr aber auch hier, dann würde der  systemd-timesyncd entfernt werden. Das 03:45
muss euch bewusst sein. Ich installiere jetzt  hier mal ntpsec also und ntpdate. Das mache 03:50
ich jetzt mal hier im Hintergrund und dann  können wir uns die beiden mal anschauen. 03:56
Jetzt installiert er die Anwendung. Das  ntpsec oder der ntpd ist der Dienst, 04:03
der beim Systemstart und im Hintergrund  regelmäßig Zeit prüft und gegebenenfalls 04:09
anpasst. Konfiguriert wird der in einer  Datei 'cat', die können wir uns angucken, 04:14
'/etc/ntpsec' jetzt neu, 'ntp.conf'  und hier sehe ich auch schon die 04:20
Server, die hier abgefragt werden sollen. Auf  dem Debian-basierten-System sind das die Debian 04:26
Timeserver z.B. 0.debian.pool.ntp.org und  1 und 2 und 3 ist alternativ. Jetzt könnte 04:31
ich den Dienst starten und dann würdet ihr aber  merken, die Uhrzeit würde noch nicht automatisch 04:39
eingestellt. Hier sagt er jetzt immer noch 14:42  Uhr. Dazu kann ich jetzt 'ntpdate' verwenden. 04:44
Dieses 'ntpdate' kann mir die Zeit direkt in dem  Augenblick mit einem der hinterlegten Zeitserver, 04:51
die ich hier in der '/etc/ntpsec/ntp.conf'  finde, konfigurieren. Also ich sage jetzt mal 05:00
'ntpdate 0.debian.pool.ntp.org' und hier sagt er  jetzt, ah, ich habe eine Abweichung und stellt 05:06
mir die Zeit jetzt hier entsprechend richtig. Da,  14:42 Uhr sagt er jetzt. Hier hat er es jetzt auch 05:14
sogar schon eingestellt. Jetzt ist die Systemzeit  aber noch nicht synchronisiert. Das heißt, 05:19
ich habe ja am Computer auch so eine Batterie  drin und eine Uhrzeit so eine Realtime Clock und 05:24
diese Zeit, die richtige Zeit, möchte ich jetzt da  reinschreiben. Dazu nutze ich den Befehl 'hwclock 05:30
--systohc', also Systemuhrzeit, die Systemuhrzeit,  die ich jetzt hier auf dem System habe, schreibe 05:40
ich jetzt in die Hardwareuhr weg. Und damit  ist die Konfiguration eigentlich auch schon 05:46
abgeschlossen von ntpsec und ntpdate und du hast  dein System auf dem aktuellen Stand. Und der ntpd, 05:52
der holt dir jetzt als Daemon in Zukunft die  Zeit immer nach und stellt die dann automatisch 06:02
für dich ein. Das Ganze gucken wir uns jetzt  trotzdem auch noch mal mit dem systemd-timesyncd 06:06
an. Den installiere ich jetzt noch mal 'sudo  apt install systemd-timesyncd' und der möchte 06:12
jetzt natürlich dann den systemd-timesyncd  installieren, der sagt mir jetzt natürlich, 06:22
der möchte das ntpsec nicht. Also es ist eine  Entweder-oder-Entscheidung. Du kannst nicht 06:28
beides auf deinem System installiert haben.  Das wird ein bisschen anders konfiguriert, 06:33
und zwar ist das ja aus dem systemd-Projekt, ein  Teil als aus dem Init-System systemd ist das ein 06:40
Teil. Das ist direkt in systemd integriert  und deswegen findet er die Konfiguration auch 06:47
dort statt. In der Regel musst du aber an der  Konfigurationsdatei von systemd-timesyncd fast 06:51
nie etwas ändern, weil die standardmässig  schon sehr gut vorkonfiguriert daherkommt. 06:57
Wenn es dich trotzdem interessiert,  kannst du mal einen Blick reinwerfen. 07:03
'cat /etc/systemd/timesyncd.conf' und das  sind jetzt mal so Default-Einstellungen, 07:07
die würde er standardmäßig nehmen, wenn du  nichts weiter konfiguriert hast. Jetzt können 07:16
wir noch mal gucken 'timedatectl status' oder wenn  jetzt nichts eingibst, macht er da automatisch 07:21
'status', einfach 'timedatectl' eingeben. Und dann  sagt er hier auch System 'Clock synchonized' 'no' 07:27
und 'NTP Service' 'inactive' und das könntest du  hier auch noch einstellen. Also wir nutzen jetzt 07:33
statt dem ntpsec den systemd-timesyncd und dann  könnte ich hier einstellen 'timedatectl set ntp 07:40
on' ist es meines Wissens nach, und dann schauen  wir noch mal rein. Und jetzt sagt er hier 'NTP 07:48
Service' 'active' und dann übernimmt auch  der systemd-timesyncd genau Funktionalität, 07:54
die sonst ntpsec oder ntpd für dich übernehmen  würden. Du kannst es für dich entscheiden, 08:00
was dir lieber ist. Es gäbe auch sonst  noch weitere Alternativen, z.B. chrony, 08:07
den könntest du dir auch noch mal anschauen. Der  ist noch etwas leichtgewichtiger als ntpsec und 08:13
was da das Richtige für dich ist, das musst  du für dich selber natürlich herausfinden. 08:19
Ich nutze ganz gerne ntpsec oder ntpdate  oder den systemd-timesyncd, je nachdem, 08:24
was für eine Konfiguration ich da gerade fahre.  systemd-timesyncd nutze ich z.B. gerne auf dem 08:31
Desktop, da kann er das einfach so machen und  wenn ich einen Server habe, dann installiere 08:36
ich mir dann gerne noch den ntpsec. Dann weiß  ich ganz genau, dass er die Uhrzeit immer 100% 08:40
sicher eingestellt. Probier das bei dir mal ein  bisschen aus. Also falls du mal diesen Fehler 08:46
hast oder z.B. ich meine, einige von euch erinnern  sich wahrscheinlich noch daran, früher gab es die 08:51
Shareware, die lief dann nach 30 Tagen ab oder  so. Da muss man die Uhrzeit zurückstellen. Also 08:56
falls du das mal ausprobieren willst, stell mal  deine Uhrzeit um. Das hatte ich dir hier gerade 09:01
gezeigt. Die kannst du ja einfach umstellen mit  dem 'timedatectl, das kann das 'set- time' und das 09:06
muss dann in diesem Format sein. Also Jahr, Minus  und das ist dann der Monat, Minus Tag, Leerzeichen 09:15
Uhrzeit:Minuten:Sekunden. Und das Ganze in  Singleticks, also die einfachen Hochkommas und 09:24
so kannst du die Uhrzeit einfach mal absichtlich  verstellen. Dazu muss aber natürlich dieser 09:29
NTP-Service deaktiviert sein, vom timedatectl,  sonst würde das automatisch direkt wieder 09:33
überschreiben. Also du müsstest dann erst setzen  'timedatectl set-ntp false', dann sagst du die 09:42
Uhrzeit 'set-time'. Das kannst du mit 'date'  noch mal prüfen. Da sehen wir wieder, oh das 09:47
hat jetzt hier immer noch nicht gemacht.  Doch 10/24 habe ich ja so gesetzt. Jetzt 09:56
setze ich hier noch mal auf 10/20. Ich  sage nochmal 'date' und jetzt sehe ich, 10:02
da hat er die Uhrzeit tatsächlich jetzt auch  umgestellt. Und dann kannst du anfangen, 10:06
da mal mit herumzuexperimentieren. Denk daran,  wenn die Zeit zu weit von der tatsächlichen Zeit 10:10
abweicht, dann geht so etwas wie Surfen nicht  mehr. Dann sagt das Internet die ganze Zeit, 10:15
deine Uhrzeit stimmt nicht. Paketaktualisierungen  gehen nicht und so weiter. Also probiere da mal 10:19
rum, stell die Uhrzeit mal so 2-3 Stunden  früher ein oder später. Am besten früher. 10:23
Und dann versuche da mal diesem timedatectl  oder ntpsec die automatische Einstellung 10:29
deiner Uhr mit NTP einzurichten. Ich wünsche  dir viel Erfolg dabei. Falls du Fragen hast, 10:34
kannst du immer bei uns in die Community kommen.  Die findest du hier bei uns auf der Webseite 10:40
https://www.spacefun.ch und dort klickst du  dann einfach auf den Punkt Community und dann 10:44
bist du eigentlich schon direkt bei uns in  der Telegram-Community drin. Das kannst du 10:52
hier einscannen und da hier auf Telegram  gehen und dann bist du sofort dabei. Ich 10:58
freue mich auf deinen Besuch. Viel Spaß  beim Nachbauen. Bis bald und Tschüss. 11:05
Hello time-jumpers! In this video, I want to show you how 00:00
to easily set the time on your Linux system. You may have experienced this before: 00:07
when you want to update your system, something goes wrong. I'm trying it here 00:12
with 'sudo apt update' in the terminal. It's starting here now, everything looks fine, 00:17
and now I get an error message saying 'Release file is not yet valid, 00:24
invalid for another 3 days.' This means something is wrong with the time on our system 00:32
. We can easily check this by entering the 'date' command. Today is 00:39
October 24, 2024, and I see here, oh, it's set to October 20. That's 00:45
wrong, of course. This means this data isn't valid for 3 days and 17 minutes. 00:53
So I need to make sure my time really corresponds to the actual time. 01:00
There are various ways to do this under Linux, and I'll show you what they look like in 01:07
this video. I'll now run all of the following commands with root privileges, as 01:12
changes to the system must be made with root privileges. Therefore, I'll start a 01:18
root shell with the command 'sudo bash'. I'm now in the root shell, which I can tell by 01:23
the 'root' at the front. Now, for the very first time on a modern 01:28
Linux system that uses systemd, I can enter the command 'timedatectl'. This will show me 01:34
exactly what the time is here. 'Local time' is 01:42
my local time, 'CEST', Central European Time. The correct time zone in this case is 'Europe/Zurich'. 01:47
You could change that with 'timedatectl' if necessary. 'System clock synchronized' says 01:54
no. 'NTP Service' says 'inactive', and that's exactly the problem. 'timedatectl' 02:01
actually already comes with its own NTP service and can also synchronize the time from the internet 02:08
. There are various other ways, and I'd like 02:13
to show you a few of them in advance. The most well-known would probably be NTP or 'ntpd'. 02:18
I'll show you how to install that. You have to do this as root. I do 02:26
n't need to precede it with 'sudo'. Otherwise, as a user, I'd type 'sudo apt install ntp' and then 02:30
I'd also install the program 'ntpdate'. With that, I can set the time directly. 02:37
But now we see here, oh, that doesn't work yet, because the time is obviously wrong. 02:45
That's why I can't make any updates at the moment. So I have to manually 02:51
set the time correctly first. And I'll do that here by 02:56
setting roughly the time we have here today. I'll say 14 03:01
and try again. I'll say 'sudo apt update' again because it's 03:10
still installing the package sources, hasn't updated them yet, and now I can actually 03:17
install it. Here it says ntp is conflicting with ntpsec, so ntp has now been replaced 03:21
by ntpsec. So I need to install the ntpsec package now, that's 03:32
changed. ntp has now been replaced by ntpsec on Debian-based systems. But then 03:38
you can see here too, then systemd-timesyncd would be removed. 03:45
You have to be aware of that. I'm now installing ntpsec and ntpdate here. 03:50
I'll do that in the background now, and then we can take a look at both. 03:56
Now it installs the application. ntpsec or ntpd is the service 04:03
that regularly checks the time at system startup and in the background, and 04:09
adjusts it if necessary. It's configured in a 'cat' file, which we can take a look at. 04:14
'/etc/ntpsec' is now new, 'ntp.conf', and here I can already see the 04:20
servers that should be queried here. On the Debian-based system, these are the Debian 04:26
time servers, e.g., 0.debian.pool.ntp.org, and 1, 2, and 3 are alternatives. Now 04:31
I could start the service, but then you'd notice that the time isn't 04:39
set automatically. Here, it still says 2:42 PM. I can now use 'ntpdate' for this. 04:44
This 'ntpdate' can configure the time for me directly at that moment using one of the stored time servers 04:51
that I find here in '/etc/ntpsec/ntp.conf'. So I say 05:00
'ntpdate 0.debian.pool.ntp.org' and here it says, oh, I have a discrepancy and 05:06
now sets the time correctly here. There, 2:42 PM, it says now. It has even 05:14
already set it here. But the system time isn't synchronized yet. That means 05:19
I have a battery in my computer and a time, a real-time clock, and 05:24
I want to write this time, the correct time, into it. To do this, I use the command 'hwclock 05:30
--systohc', which means system clock time. 05:40
I now write the system clock time that I have here on the system to the hardware clock. And with that, the configuration of ntpsec and ntpdate is essentially 05:46
complete, and you have your system up to date. And ntpd, 05:52
as a daemon, will now always check your time and automatically set it 06:02
for you. Let's take another look at the whole thing with systemd-timesyncd 06:06
. I'll install it again now with 'sudo apt install systemd-timesyncd', and it will 06:12
of course then want to install systemd-timesyncd, but it will tell me 06:22
that it doesn't want ntpsec. So it's an either/or decision. You can't 06:28
have both installed on your system. It's configured a little differently, 06:33
namely, it's part of the systemd project than it is part of the systemd init system 06:40
. It's directly integrated into systemd, and that's why the configuration takes 06:47
place there. Generally, though, you almost never have to change the systemd-timesyncd configuration file 06:51
, because it's already very well preconfigured by default. 06:57
If you're still interested, you can take a look. 07:03
'cat /etc/systemd/timesyncd.conf' and these are the default settings 07:07
it would use if you haven't configured anything else. Now 07:16
we can look again at 'timedatectl status' or if you don't enter anything now, it will automatically do 07:21
'status', just enter 'timedatectl'. And then it will say 'System Clock synchronized' 'no' 07:27
and 'NTP Service' 'inactive' and you could set that here too. So now we're using 07:33
systemd-timesyncd instead of ntpsec and then I could set 'timedatectl set ntp 07:40
on' here, as far as I know, and then we'll take another look. And now it will say 'NTP 07:48
Service' 'active' and then systemd-timesyncd will take over exactly the functionality 07:54
that ntpsec or ntpd would otherwise do for you. You can decide for yourself 08:00
which you prefer. There are other alternatives, for example chrony, 08:07
which you could also take a look at. It's a bit more lightweight than ntpsec, and 08:13
of course you'll have to find out for yourself which is right for you. 08:19
I like to use ntpsec or ntpdate or systemd-timesyncd, depending on 08:24
what configuration I'm running. I like to use systemd-timesyncd on the 08:31
desktop, for example, so it can do it that way, and if I have a server, 08:36
I like to install ntpsec as well. Then I know for sure that it always 08:40
sets the time 100% reliably. Try it out for a bit. So if you ever 08:46
have this error, or for example, I mean, some of you probably remember, there used to be 08:51
shareware that expired after 30 days or something. You have to set the time back. So 08:56
if you want to try it out, try changing your clock. I just 09:01
showed you how. You can easily change it with 'timedatectl', which can be 'set-time', and it 09:06
must be in this format. So year, minus, and that's the month, minus day, space 09:15
time:minutes:seconds. And the whole thing in single ticks, so the single quotes, and 09:24
so you can simply change the time intentionally. But of course, this 09:29
The NTP service must be deactivated by timedatectl, otherwise it would automatically 09:33
overwrite it. So you'd first have to set 'timedatectl set-ntp false', then specify the 09:42
time 'set-time'. You can double-check this with 'date'. There we see again, oh, it 09:47
still hasn't done this. But I set it to 10/24 like this. Now 09:56
I set it to 10/20 again. I say 'date' again, and now I see 10:02
that it has actually changed the time. And then you can start 10:06
experimenting with it. Remember, if the time 10:10
deviates too far from the actual time, things like surfing won't work. Then the internet will constantly say 10:15
your time is wrong. Package updates won't work, and so on. So experiment 10:19
with it, try setting the time 2-3 hours earlier or later. Earlier is best. 10:23
Then try using timedatectl or ntpsec 10:29
to set up automatic clock settings with NTP. I wish you the best of luck. If you have any questions, 10:34
you can always join our community. You can find it here on our website 10:40
https://www.spacefun.ch. Simply click on the "Community" item and 10:44
you'll be instantly connected to our Telegram community. You can 10:52
scan it here and go to Telegram, and you'll be instantly connected. I 10:58
look forward to your visit. Have fun building it. See you soon, and goodbye. 11:05

In diesem Video zeige ich dir, wie du unter Linux das Datum und die Uhrzeit richtig einstellst.

Wir starten mit systemd-timesyncd – der super einfachen Methode, um deine Uhrzeit automatisch mit einem Zeitserver zu synchronisieren. Ich führe dich Schritt für Schritt durch die Aktivierung und Konfiguration.

Aber das ist noch nicht alles! Wir werfen auch einen Blick auf die Power-Tools ntpsec und ntpdate – perfekt für alle, die ihre Zeit manuell oder automatisch abgleichen wollen.

Und falls du lieber die Kontrolle über die Uhrzeit behalten möchtest, zeige ich dir, wie du sie von Hand setzen kannst. Mit den besten Tipps und Tricks, damit deine Uhr immer genau tickt! ⏰

Egal, ob du ein Neuling oder ein Linux-Profi bist – dieses Video hat für jeden etwas zu bieten! Also schau rein und mach deine Linux-Uhr zum Schweizer Meisterwerk!

Navigation

Video Player