Solved

Git Check Time of Client

Posted on 2016-09-12
2
20 Views
Last Modified: 2016-10-03
We need to check time of Client from where user is connecting to git server & refuse the connection if the time difference between the server & client is not correct by some margin.

Example : if the time on Server is 18:00 UTC & the time of client is 21:00 UTC, I would like to refuse connection.

I believe this should be forced at Linux Server Level.Please let me know how to accomplish this.
0
Comment
Question by:sivaatluri
  • 2
2 Comments
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 total points (awarded by participants)
ID: 41797161
I think you will have to write your own solution. What you need to do is connect to the client system on port 37 (the timeserver port) and read the client's idea of the time from there, as per RFC 868. This requires that clients support time service: under Linux, inetd supports time as an internal service (so it has to be enabled in /etc/inetd.conf); under Windows I do not know what to do, but likely you additionally have to enable port 37 in the firewall.
You can get a report of the time difference from the netdate utility (not run as root ;)
11:08:53$ netdate dwarfstar
netdate: settimeofday: Operation not permitted
dwarfstar -11.352        Wed Sep 14 11:11:17.000
11:11:28$ 

Open in new window

Slackware has had netdate for ever. It's very old, and I couldn't easily find it on the web. I can post the source as an attachment if you like - it's only about 500 lines.

Do you need a plan for integrating your solution with the git server?
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 41826014
The proposed solution is certainly valid as far as it goes. It does require some effort on the part of the author to implement a working solution, but describes the steps necessary to achieve one.
The author has not seen fit to respond , so we have to assume he is content with this partial solution, and close it with a 'B'.
Should the author wish to keep the question open, he has 4 days to object to the proposed closure.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
To properly understand GitHub, let’s divide it into two words ‘Git’ and ‘Hub’. Git is basically a ‘Distribution Version Control’ (DVC) and ‘Source Code Management’ (SCM) system widely used by software programmers while Hub means the efficient centre…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now