Howto sync date over ssh

sync date

1. On client systems, edit /etc/ssh/sshd_config file and enable root login. Restart sshd by running /etc/init.d/sshd restart

2. copy generated id_rsa.pub from the control machine to the target machine and change the file name to authorized_keys (See sshd howto link from an earlier blog entry)

3. create syncdate.sh and change master_date_host to the actual host name.
#!/bin/sh
for in in `cat hosts`
do
ssh -T root@$i `rdate master_date_host”
done

4. create hosts file containing host names

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s