Results 1 to 3 of 3
I have a windows PC connected to a Linux Server via the LAN port and am using SSH (Putty). I am using the pscp command to copy files to and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-14-2013 #1
- Join Date
- May 2013
how to set date & time from Windows PC connected to a Linux Server
I have a windows PC connected to a Linux Server via the LAN port and am using SSH (Putty).
I am using the pscp command to copy files to and from the Linux server via a batch file using the command prompt in windows. Also able to call the batch file from within a VBA application.
Question: Is it possible to set the date and time on the Linux server according to the Windows system date and time. If the answer is yes, can it be also done from within a VBA application in Excel? A solution would be much appreciated.
- 05-14-2013 #2
Hi and welcome
If the account you use with ssh is root (bad idea) or can escalate to root (slightly less bad idea), then you *could* set the time on the linux machine.
But the better approach is to set the windows time via your AD, and use a ntp server for linux.
This way all machines in your network will be synchronized and your copy script doesnt have to deal with problems it isnt intendend for.You must always face the curtain with a bow.
- 05-14-2013 #3
- Join Date
- May 2013
Thanks for your welcome message and also your prompt solution.
I should have clarified the actual situation in that the Linux "Server" is not really a Server per se but more in the sense of my Windows PC being a client to the Linux Box ie "server". The Linux box is standalone and running its own Telephony application but does not have a RTC (Real Time Clock). In normal applications the Linux Box will be connected to the Internet via its WAN port and when it boots up the date and time will be taken from a ntp pool.
However there is a special requirement for this Linux Box to be installed in a place where there is no access to the internet. While I am testing, I SSH to the root and set the date from the command line (root:> date -s 2013.05.11-18:11:26) which is in the format "yyyy.mm.dd-hh:mm:ss"
I do not want to give root access to the customer, for obvious reasons, whose PC (lan port) will be connected the linux box (lan port) but rather do it through a VBA Excel macro. By the way, I am already copying files to and from the linux box using VBA Excel macros by just clicking on Radio buttons assigned to the relevant macros.
Trust the above gives a better picture of the actual situation.