Wednesday, October 10, 2012

How to grant permissions to edit etc/hosts file to all users

If you want to grant permissions to edit /etc/hosts file to all users without granting root permission,this is the simple way to do that.
log in to the system from root user and just enter,
"chmod a+w /etc/hosts"

Ex :

$ ls -la /etc/hosts
-rw-r--r-- 1 root wheel 236 Sep 23 2007 /etc/hosts
$ cat >> /etc/hosts
-bash: /etc/hosts: Permission denied
$ su admin
Password:
$ sudo chmod a+w /etc/hosts
Password:
$ exit
logout
$ ls -la /etc/hosts
-rw-rw-rw- 1 root wheel 241 Mar 9 15:37 /etc/hosts
$ cat >> /etc/hosts
test
$ tail -1 /etc/hosts
test

More infomation available at 
http://hintsforums.macworld.com/archive/index.php/t-99568.html 

Thursday, October 4, 2012

How to syncronize system clock with time servers

you can find the more information about NTP (Network Time Protocol) from here. But if you want to sync system time in your Linux machine. there's only two commands you need to execute.

1. First you have to install NTP. if you are using RHEL,
    do a "yum install ntp"
or if you are using ubuntu,
   "apt-get install NTP"

2. then execute "ntpdate 0.pool.ntp.org"

It will synchronize your system clock.