How To Change Timezone on a CentOS 6 and 7 Easily

You can easily change timezone in CentOS Linux using the following methods.
CentOS timezone config files and directories

/usr/share/zoneinfo/ – The system timezone directory contains the files as per timezone name. For example, the file /usr/share/zoneinfo/America/New_York represents time zone for New York.
/etc/localtime – It is a symlink to the file localtime or to the correct timezone file in the system located in /usr/share/zoneinfo/ directory.
How do I see the current time zone?

Type the date command or the ls command:
$ date
$ ls -l /etc/localtime


To find list of all available time zones, run:
# timedatectl list-timezones
##*** Grep possible Asian timezones ***##
# timedatectl list-timezones | grep Asia

Sample outputs:

…. Continue reading


rpcbind is new portmap or how to make nfs secure on Linux

I was installing NFS server on otherwise public host recently, and noticed that conventional wisdom about securing NFS server is somewhat dated. My goal was to expose NFS on two internal interfaces without exposing it to whole wide Internet (assumptions about network security changed a lot since NFS was designed, sadly).

For a start, you are probably running rpcbind instead of portmap on recent Debian installations. So you will need to modify flags which are passed to portmap on startup:

root@rsync1:~# cat /etc/default/rpcbind 
OPTIONS="-w -l -h -h"

You will also need to add following line:

root@rsync1:~# grep rpcbind /etc/hosts.deny 
rpcbind: ALL

Now you will notice that rpcinfo -p still works OK on localhost. That’s because rpcbind will always add loopback address, so we have to test it from another machine:

root@rsync1-dev:~# rpcinfo -p
rpcinfo: can't contact portmapper: RPC: Authentication error; why = Client credential too weak

Continue reading