Solved

Git Check Time of Client

Posted on 2016-09-12
2
27 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

777 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