Aller au contenu

VPS sous Centos 7 impossible de le synchroniser à l'heure Fr


kalistyan

Messages recommandés

Bonjour,

Je rencontre un problème de synchronisation avec un VPS sous CentOS 7 (OpenVZ). 

La timezone est correctement configurée.

[root@srv-sync01 ~]# ls -l /etc/localtime
lrwxrwxrwx 1 root root 32 Nov  4 13:40 /etc/localtime -> /usr/share/zoneinfo/Europe/Paris
[root@srv-sync01 ~]# date
Wed Nov  4 14:09:48 CET 2015
[root@srv-sync01 ~]#

J'ai essayé avec la commande ntpdate.

[root@srv-sync01 ~]# ntpdate ntp.univ-lyon1.fr
 4 Nov 14:13:12 ntpdate[776]: step-systime: Operation not permitted
[root@srv-sync01 ~]#

J'ai aussi testé avec ntp, mais le service ne démarre pas. Même la méthode ci-dessous ne donne rien.
https://wiki.gutzmann.com/confluence/display/HowTo/NTPD+-+cap_set_proc()+failed+to+drop+root+privileges%3A+Operation+not+permitted

[root@srv-sync01 ~]# systemctl status ntpd
ntpd.service - Network Time Service
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled)
   Active: failed (Result: exit-code) since Wed 2015-11-04 14:23:27 CET; 3min 47s ago
  Process: 850 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 851 (code=exited, status=255)

Nov 04 14:23:27 srv-sync01 ntpd[851]: Listen normally on 2 lo 127.0.0.1 UDP 123
Nov 04 14:23:27 srv-sync01 ntpd[851]: Listen normally on 3 venet0:0 149.91.82.147 UDP 123
Nov 04 14:23:27 srv-sync01 ntpd[851]: Listen normally on 4 lo ::1 UDP 123
Nov 04 14:23:27 srv-sync01 ntpd[851]: Listening on routing socket on fd #21 for interface updates
Nov 04 14:23:27 srv-sync01 ntpd[851]: 0.0.0.0 c016 06 restart
Nov 04 14:23:27 srv-sync01 ntpd[851]: 0.0.0.0 c012 02 freq_set kernel 0.000 PPM
Nov 04 14:23:27 srv-sync01 ntpd[851]: 0.0.0.0 c011 01 freq_not_set
Nov 04 14:23:27 srv-sync01 ntpd[851]: cap_set_proc() failed to drop root privileges: Operation not permitted
Nov 04 14:23:27 srv-sync01 systemd[1]: ntpd.service: main process exited, code=exited, status=255/n/a
Nov 04 14:23:27 srv-sync01 systemd[1]: Unit ntpd.service entered failed state.
[root@srv-sync01 ~]#

Il est en réalité 12h34

Le support m'envoie des réponses basiques, j'suis pourtant passé en niveau 2.

Y aurait-il un expert CentOS dans le coin ?

Kali'

Lien vers le commentaire
Partager sur d’autres sites

Salut,

Comme demandé.

Le fichier a bien été édité.

 

[root@srv-sync01 ~]# vi /etc/ntp.conf
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default nomodify notrap nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.fr.pool.ntp.org iburst
server 1.fr.pool.ntp.org iburst
server 2.fr.pool.ntp.org iburst
server 3.fr.pool.ntp.org iburst

#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst

#broadcast 192.168.1.255 autokey        # broadcast server
#broadcastclient                        # broadcast client
#broadcast 224.0.1.1 autokey            # multicast server
#multicastclient 224.0.1.1              # multicast client
#manycastserver 239.255.254.254         # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

# Enable public key cryptography.
#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats

# Disable the monitoring facility to prevent amplification attacks using ntpdc
# monlist command when default restrict does not include the noquery flag. See
# CVE-2013-5211 for more details.
# Note: Monitoring will not be disabled with the limited restriction flag.



 

[root@srv-sync01 ~]# ntpq -p
ntpq: read: Connection refused
[root@srv-sync01 ~]#

Comme indiqué dans mon message précédent, le service ntpd ne démarre pas.

Lien vers le commentaire
Partager sur d’autres sites

je ne peux pas lire ce forum depuis le boulot, un petit malin a dû faire des bêtises, on est bannis :D
je regarderai ce soir si je rentre ;)

je suppose que tu as déjà réinstallé le paquet ?

je ne vois pas ton serveur de temps 

ntp.univ-lyon1.fr

dans ton fichier ntp.conf, tu l'as édité après ? 

ton ntpdate tu l'as fais comme suit ? (trouvé sur la FAQ trucs et astuces du site wiki.CentOS)

/usr/sbin/ntpdate -u -s 0.centos.pool.ntp.org 1.centos.pool.ntp.org 2.centos.pool.ntp.org && /sbin/hwclock -w 
Lien vers le commentaire
Partager sur d’autres sites

×
×
  • Créer...